Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

public static 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