[Expand]General Information
[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
  [Expand]Behaviors
  [Expand]Services
  [Collapse]DXBinding
    Language Specification
    DXBinding
    DXCommand
    DXEvent
    Example
    DXDataTemplateSelector
  [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]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Language Specification

There is a special language that is used in the DevExpress binding mechanism. This language combines C# and XAML rules. This topic describes these rules in detail.

Expanded Literals

The following literals are used in the same way as those in C#.

To define a string literal, use the ` (grave accent) symbol.

The 'true', 'false', 'null' words are reserved. Words 'True', 'False', 'Null' are not literals.

Char constants are defined in the following manner:

Expanded Properties

The following properties are used in the same way as those in C#.

Expanded Functions

You can invoke functions inside the DXBinding's expression and pass parameters to them.

Expanded Indexer

The indexer is used in the same way as the one in C#.

Expanded Types and Static Properties

Type definitions start with the $ symbol.

There are some primitive types: $int, $double, ..., $string, $object, $bool.

The XAML engine resolves the other types.

The typeof word is reserved.

The ? symbol is used for declaring nullable types: $int?, $Type?, $dx:Type?.

Expanded Type Casting

Type casting statements are the same as those in C#.

Expanded Attached Properties

Attached Properties are used in the same way as those in standard bindings. Note that the "$" (dollar) sign should be used to specify a defining type.

Expanded Operators

The DXBinding supports the following operators:

  • Arithmetic operators

              Operator Name          

              Syntax          

       Alternative Syntax   

    Unary plus +a
    -
    Unary minus -a
    -
    Addition a + b
    -
    Subtraction a - b
    -
    Multiplication a * b
    -
    Division a / b
    -
    Modulo a % b
    -
  • Comparison and relational operators

              Operator Name          

              Syntax          

       Alternative Syntax   

    Equal to a eq b a == b
    Not equal to a ne b a != b
    Greater than a gt b a > b
    a > b
    Less than a lt b a < b
    Greater than or equal to a ge b a >= b
    a >= b
    Less than or equal to a le b a <= b
    Type compatibility a is b
    -
    Type conversion a as b
    (b)a
    -
  • Logical operators

              Operator Name          

              Syntax          

       Alternative Syntax   

    Not !a
    -
    And a and b a && b
    Or a or b a || b
    Condition a ? b : c
    -
    Null Coalesce a ?? b
    -
  • Bitwise operators

              Operator Name          

              Syntax          

       Alternative Syntax   

    Not ~a
    -
    And a & b
    -
    Or a | b
    -
    Xor a ^ b
    -
    Left shift a shl b a << b
    Right shift a shr b a >> b
    a >> b
  • new operator. Creates a new instance of a specified class.
  • Assignment operator =. Only the the DXEvent and DXCommand extensions support this operator.

The operator priority is the same as in C#.

Expanded Special Words

The DXBinding language supports some reserved words. These words specify locations relative to the target's position.

  • @s, @Self
  • @p, @TemplatedParent
  • @e, @ElementName
  • @r, @StaticResource
  • @a, @FindAncestor
  • @c, @DataContext
  • @Reference

When specifying the DXBinding.BackExpr property, you can use the @v or @value reserved word to access the input value.

When the DXCommand markup extension is used, you can use all the DXBinding's special words plus the @parameter word to access the CommandParameter.

The DXEvent markup extension supports all the DXBinding's special words plus the @sender and @args words to access the event sunder and event arguments.

Expanded Typization

DXBinding, DXCommand, DXEvent use interpretation. This allows using dynamic typization, so you do no need to cast values.

In the following example, Value1 and Value2 can be of different types:

Such expressions are invalid in C#.

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