DataErrorValidationRule DataErrorValidationRule DataErrorValidationRule DataErrorValidationRule Class

Definition

Represents a rule that checks for errors that are raised by the IDataErrorInfo implementation of the source object.

public ref class DataErrorValidationRule sealed : System::Windows::Controls::ValidationRule
public sealed class DataErrorValidationRule : System.Windows.Controls.ValidationRule
type DataErrorValidationRule = class
    inherit ValidationRule
Public NotInheritable Class DataErrorValidationRule
Inherits ValidationRule
Inheritance
DataErrorValidationRuleDataErrorValidationRuleDataErrorValidationRuleDataErrorValidationRule

Remarks

The WPF data binding model enables you to associate ValidationRules with a Binding object. If your source object implements the IDataErrorInfo interface, you can use the built-in rule DataErrorValidationRule to check for errors raised by the IDataErrorInfo implementation.

An alternative syntax to setting the DataErrorValidationRule explicitly is to set the ValidatesOnDataErrors property to true on your Binding or MultiBinding object.

You can create a custom rule by creating a class that derives from ValidationRule. For more information and a detailed discussion of data validation, see Data Binding Overview.

DataErrorValidationRule is introduced in the .NET Framework version 3.5. For more information, see Versions and Dependencies.

Constructors

DataErrorValidationRule() DataErrorValidationRule() DataErrorValidationRule() DataErrorValidationRule()

Initializes a new instance of the DataErrorValidationRule class.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Validate(Object, CultureInfo) Validate(Object, CultureInfo) Validate(Object, CultureInfo) Validate(Object, CultureInfo)

Performs validation checks on a value.

Validate(Object, CultureInfo, BindingExpressionBase) Validate(Object, CultureInfo, BindingExpressionBase) Validate(Object, CultureInfo, BindingExpressionBase) Validate(Object, CultureInfo, BindingExpressionBase)

Performs validation checks on a value.

(Inherited from ValidationRule)
Validate(Object, CultureInfo, BindingGroup) Validate(Object, CultureInfo, BindingGroup) Validate(Object, CultureInfo, BindingGroup) Validate(Object, CultureInfo, BindingGroup)

Performs validation checks on a value.

(Inherited from ValidationRule)

Properties

ValidatesOnTargetUpdated ValidatesOnTargetUpdated ValidatesOnTargetUpdated ValidatesOnTargetUpdated

Gets or sets a value that indicates whether the validation rule runs when the target of the Binding is updated.

(Inherited from ValidationRule)
ValidationStep ValidationStep ValidationStep ValidationStep

Gets or sets when the validation rule runs.

(Inherited from ValidationRule)

Applies to

See Also