Skip to content

DevExpress-Examples/wpf-mvvm-behaviors-create-a-custom-behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF MVVM Behaviors - Create a Custom Attached Behavior

Each Behavior is a Behavior<T> class descendant. The T parameter defines the associated control type.

The Behavior<T> class contains the AssociatedObject property. DevExpress MVVM Framework specifies this property when you add a Behavior to the Behaviors collection.

After the AssociatedObject is specified, DevExpress MVVM Framework invokes the virtual OnAttached method. You can override this method to subscribe to AssociatedObject's events and initialize its properties.

To unsubscribe from events, you can use the virtual OnDetaching method. DevExpress MVVM Framework invokes when the Behavior is destroyed.

Files to Look At

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)