Validation
ValidationRules
Inherit
ValidationRule
and overrideValidate()
.Instantiate and add to the
Binding.ValidationRules
collection.Use the
ValidationStep
property to control when it should be applied. The possible values areConvertedProposedValue
,CommittedValue
,RawProposedValue
, andUpdatedValue
.
IDataErrorInfo
Used for sync validation where only single validation result suffices. Implemented by View Model. Apply
ValidatesOnDataErrors
orDataErrorValidationRule
for binding.
INotifyDataErrorInfo [.net 4.5]
Used for sync/async validation when more than one validation result is available. Implemented by View Model. Apply
ValidatesOnNotifyDataErrors
orNotifyDataErrorValidationRule
for binding.
Enterprise Library 5.0 Validation Application Block
Supports defining validation rules by using attributes, configuration, and self-validation which can also be consolidated
Windows WF
Used for more complex sync/async business rules validations
Validation.ErrorTemplate
Used to specify the template when control value fails validation