| Start |
|---|
| Creating a custom validation attribute Custom validation attributes can be created by deriving from the This attribute can then be used like this: |
| Data Annotation Basics Data annotations are a way of adding more contextual information to classes or members of a class. There are three main categories of annotations:
UsageHere is an example where two Data annotations are mostly used in frameworks such as ASP.NET. For example, in |
| Manually Execute Validation Attributes Most of the times, validation attributes are use inside frameworks (such as ASP.NET). Those frameworks take care of executing the validation attributes. But what if you want to execute validation attributes manually? Just use the Validation ContextAny validation needs a context to give some information about what is being validated. This can include various information such as the object to be validated, some properties, the name to display in the error message, etc. Once the context is created, there are multiple ways of doing validation. Validate an Object and All of its PropertiesValidate a Property of an ObjectAnd MoreTo learn more about manual validation see: |
| EditableAttribute (data modeling attribute)
Simple usage example in XAML application |
| Manually Execute Validation Attributes Most of the times, validation attributes are use inside frameworks (such as ASP.NET). Those frameworks take care of executing the validation attributes. But what if you want to execute validation attributes manually? Just use the Validation ContextAny validation needs a context to give some information about what is being validated. This can include various information such as the object to be validated, some properties, the name to display in the error message, etc. Once the context is created, there are multiple ways of doing validation. Validate an Object and All of its PropertiesValidate a Property of an ObjectAnd MoreTo learn more about manual validation see: |
| DisplayNameAttribute (display attribute)
Simple usage example in XAML application |
Read Article
https://develop.horje.com/learn/1434/reference