Attaching MVVM Behaviors and Services
To attach the components from DevExpress MVVM Framework (behaviors and services), press the button, then select the required behavior or service from the Add Behavior or Add Service menu.
The list of available behaviors and services can differ depending on which element is selected.
To add a behavior (for instance, the EventToCommand) open the Smart Tag for the window (click the button) and press Add Behavior.
Click the EventToCommand item and select the newly added element in the list of behaviors. Set the required properties.
As a result, Smart Tag will generate the following code in XAML.
<dx:DXWindow
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
...
DataContext="{dxmvvm:ViewModelSource Type={x:Type ViewModel:MainViewModel}}">
<dxmvvm:Interaction.Behaviors>
...
<dxmvvm:EventToCommand Command="{Binding OnLoadedCommand}" EventName="Loaded"/>
...
</dxmvvm:Interaction.Behaviors>
...
</dx:DXWindow>
A similar code can be used to manually attach other behaviors from the DevExpress MVVM Framework.