DXBinding

Binding Tools

The DevExpress Binding mechanism includes three powerful tools that extend standard WPF bindings.

  • The DXBinding allows you to use expressions inside binding paths.

    IsEnabled="{DXBinding '!HasError'}"
    IsEnabled="{DXBinding 'GetHasError(Text)'}"
    Margin="{DXBinding 'new $Thickness(LeftIndent, 0, 0, 0)'}"
    
  • With the DXCommand, you can bind a command property and define methods to call right in xaml.

    <Button Command="{DXCommand 'SaveDocument(DocumentName); CloseDocument(DocumentName)'}"/>
    <Button Command="{DXCommand '@e(checkBox).IsChecked=true'}"/>
    
  • The DXEvent allows you to bind an event to methods.

    <Window Loaded="{DXEvent InitializeViewModel()}"/>
    <Button Click="{DXEvent '@e(checkBox).IsChecked=true'}"/>
    

The Language Specification topic describes the language that is used in the DevExpress binding mechanism.

Declarative Template Selector

The DXDataTemplateSelector is a declarative way to implement DataTemplateSelector.

The DXDataTemplateSelector allows you to define a simple template selection logic in XAML, so you do not need to create a DataTemplateSelector ancestor in code-behind. The DXDataTemplateSelector works like WPF triggers.

See Also