Validation Class
Collapse the table of content
Expand the table of content

Validation Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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


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

public static class Validation

The Validation type exposes the following members.

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.

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.

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

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.

© 2017 Microsoft