Dynamic Properties. Learn More

DynamicPropertiesObject and XAF validation

If necessary, it is possible to apply validation mechanism to DynamicPropertiesObject objects. To do this verifiable Dynamic Property must have special rule attributes derived from RuleBaseAttribute.

Thus, when creating Dynamic Property it is sufficient to specify constructor parameters properly, you should specify a such DynamicProperty.Attributes collection, which contains the validation attributes. No additional manipulation to initialize Dynamic Property do not need. If the standard validation Actions for some reason are not active, then to check the validity of the object is sufficient to use one of the validation methods of DevExpress.Persistent.Validation.RuleSet class. Use static property of the DevExpress.Persistent.Validation.Validator class to access RuleSet class. The following code snippet demonstrates how to call RuleSet.Validate for Dpo object.

  • example

Validator.RuleSet.Validate(this.ObjectSpace, obj.Dpo, ContextIdentifier.Save);

obj represent DynamicPropertiesValidationSupport and Dpo - DynamicPropertiesObject.