- 3 minutes to read
The DevExpress MVVM Framework helps you to use the Model-View-ViewModel design pattern in WinUI applications. Refer to the following MSDN article for more information about this pattern: The MVVM Pattern.
This documentation section contains the following topics that describe features of the DevExpress MVVM Framework.
The following classes simplify bindable property implementation:
- A ViewModel that supports the INotifyPropertyChanged interface and allows you to use GetProperty and SetProperty methods to implement bindable properties.
- The BindableBase descendant that implements the ISupportUIServices interface and allows you to access UI Services registered within a View.
- View Models Generated at Compile Time
The MVVM Framework allows you to produce boilerplate code for your View Models. In this case, you do not need to implement each command or property.
Commands allow you to define actions in a View Model and then bind to them from any place in a View. DevExpress WinUI MVVM Framework includes the following commands:
- A delegate command that implements the ICommand interface and calls your parameterless delegates when Execute and CanExecute logic is invoked on the command.
- A delegate command that implements the ICommand interface and calls your parameterized delegates when Execute and CanExecute logic is invoked on the command.
- An asynchronous command without a command parameter.
- An asynchronous command whose Execute(T) and CanExecute(T) delegates accept a command parameter of the T type.
Behaviors extend the capabilities of visual controls and adhere to the MVVM pattern. You can implement missing functionality with a custom Behavior and use it at any place in your application. DevExpress WinUI MVVM Framework includes the following behaviors:
- Allows you to bind a ViewModel property to a control’s non-dependency property.
- Executes a command in response to a raised event.
- Focuses a UI control without code-behind.
- Allows you to specify a key combination that invokes a command.
UI services allow you to access UI functionality from your view model in MVVM applications. Although services are defined within Views, their functionality can still be invoked from View Models that may not even include information about Views. DevExpress WinUI MVVM Framework includes the following UI services:
- A UI service that allows you to use the DispatcherQueue to perform actions in a ViewModel.
- The UI service that allows you to show messages.
- Implements the IMessenger interface and allows you to exchange messages between application modules.
- Contains helper methods that allow you to specify a property value.
- Allows you to define a simple template selection logic in XAML. The class is a declarative way to implement the DataTemplateSelector.