Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
  [Expand]ViewModels
  [Expand]Commands
  [Collapse]Behaviors
    Getting Started
   [Expand]Predefined Set
    How to: Create a Custom Behavior
  [Expand]Services
  [Expand]DXBinding
  [Expand]MIF
   Converters
   ViewLocator
   Messenger
   Data Annotation Attributes
   LayoutTreeHelper
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Getting Started

The Behavior mechanism extends the capabilities of visual controls and adheres to the MVVM pattern. You can implement missing functionality with a custom Behavior and begin using it any place in your application without code-behind and duplicated code.

Expanded Regular approach to define Behaviors

The DevExpress.Mvvm.UI.Interactivity.Interaction class implements a Behaviors attached property. This property is read-only and contains a collection of Behaviors. To use a Behavior, place it in this collection in XAML.

Behaviors can provide dependency properties, which you can set or bind. For instance:

Expanded How to define and use Behaviors in styles

The DevExpress.Mvvm.UI.Interactivity.Interaction class implements a BehaviorsTemplate attached property. This property can be used to apply Behaviors in a style. For instance:

If it is necessary to define more than one Behavior, you can place behaviors on the ItemsControl element, instead of the ContentControl.

Is this topic helpful?​​​​​​​