Expression. Getting Started | Xafari Xtra Editors
Select Page

 Getting Started

This topic explains, how to implement the ExpressionObject business class, which allows to demonstrate the functionality of the Xafari Expression Property Editor. Follow the steps described below.

Add a new Domain Component to the Module Project, name it ExpressionObject, declare the Expression and Type properties as follows:

You can view the code used in this lesson in the Xafari.XtraEditors.Module | Editors| ExpressionObject.cs file of the Xafari XtraEditors demo installed with product.

The EditorAlias attribute indicates, that the Expression property will be displayed via the ExpressionPropertyEditor. An alternative approach is to use the Model Editor.

Type property allows to associate an expression with a context type. [CriteriaOptions("Type")] attribute decorates the Expression property, it means that the Type property specifies the context type for the expression. If the context type is null, then the Expression Editor does not display the metadata tree.

Note: To calculate the value of the expression it is necessary to use the GetValue method of the ExpressionCalculator static class: