Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[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]Document Server
[Expand]Reporting
[Expand]Report 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 mixes C# and XAML rules. This topic describes these rules in detail.

Expanded Literals

These 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

These 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.

Other types are resolved by the XAML engine.

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.

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

The operator priority is the same as in C#.

Expanded Special Words

There are some reserved words supported by the DXBinding language. These words specify locations relative to the position of the target.

  • @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.

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