Windows Dev Center

Validation Class

Provides methods and attached properties that support data validation and govern the visual state of the control.

System.Object
  System.Windows.Controls.Validation

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Public NotInheritable Class Validation

The Validation type exposes the following members.

  NameDescription
Public attached propertyErrorsGets a collection of ValidationError objects associated with the binding target element.
Public attached propertyHasErrorGets a value that indicates whether any binding on the target element has a validation error.
Top

  NameDescription
Public methodStatic memberGetErrorsGets the value of the Errors attached property for the specified element.
Public methodStatic memberGetHasErrorGets the value of the HasError attached property for the specified element.
Top

  NameDescription
Public fieldStatic memberErrorsPropertyIdentifies the Errors attached property.
Public fieldStatic memberHasErrorPropertyIdentifies the HasError attached property.
Top

The Validation class provides support for displaying validation error information by using a control template. For more information about control templates, see ControlTemplate.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2015 Microsoft