Skip to main content


DXCommand allows you to bind a command property to the method or property. The DevExpress binding mechanism requires special language expressions. Refer to the following topic for more information: Language Specification. The code sample below shows how to specify the Execute and CanExecute delegates.

<Button Content="OK" Command="{DXCommand Execute='Save(); Close()', CanExecute='CanSave() and CanClose()'}"/>

If you bind DXCommand.CanExecute to a property, you need to raise the PropertyChanged event to update the CanExecute state.

You can pass a parameter to the method that you call.

<TextBlock x:Name="tb" Text="text"/>
<Button Content="OK" Command="{DXCommand Execute='Save(@e(tb).Text)', CanExecute='CanSave(@e(tb).Text)'}"/>

Use the @parameter reserved word to access the CommandParameter value.

<TextBlock x:Name="tb" Text="text"/>
<Button Content="OK" Command="{DXCommand Execute='Save(@parameter)', CanExecute='CanSave(@parameter)'}" CommandParameter="{DXBinding @e(tb).Text}"/>

The DXCommand extension supports the “=” operator.

<Button Command="{DXCommand '@e(checkBox).IsChecked=true'}"/>