Validation Class
Provides methods and attached properties that support data validation.
Assembly: PresentationFramework (in PresentationFramework.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | Errors | Gets the collection of all active ValidationError objects on the bound element. |
![]() ![]() | ErrorTemplate | Gets or sets the ControlTemplate used to generate validation error feedback on the adorner layer. |
![]() ![]() | HasError | Gets a value that indicates whether any binding on the binding target element has a ValidationError. |
![]() ![]() | ValidationAdornerSite | Gets or sets the element that appears to indicate that a validation error occurred on the bound element where this property is set. |
![]() ![]() | ValidationAdornerSiteFor | Gets or sets the element for which this element appears to indicate that an error occurred. |
| Name | Description | |
|---|---|---|
![]() ![]() | AddErrorHandler(DependencyObject^, EventHandler<ValidationErrorEventArgs^>^) | Adds an event handler for the Error attached event to the specified object. |
![]() ![]() | ClearInvalid(BindingExpressionBase^) | Removes all ValidationError objects from the specified BindingExpressionBase object. |
![]() ![]() | GetErrors(DependencyObject^) | Gets the value of the Errors attached property of the specified element. |
![]() ![]() | GetErrorTemplate(DependencyObject^) | Gets the value of the ErrorTemplate attached property of the specified element. |
![]() ![]() | GetHasError(DependencyObject^) | Gets the value of the HasError attached property of the specified element. |
![]() ![]() | GetValidationAdornerSite(DependencyObject^) | Gets the value of the ValidationAdornerSite attached property for the specified element. |
![]() ![]() | GetValidationAdornerSiteFor(DependencyObject^) | Gets the value of the ValidationAdornerSiteFor attached property for the specified element. |
![]() ![]() | MarkInvalid(BindingExpressionBase^, ValidationError^) | Marks the specified BindingExpression object as invalid with the specified ValidationError object. |
![]() ![]() | RemoveErrorHandler(DependencyObject^, EventHandler<ValidationErrorEventArgs^>^) | Adds an event handler for the Error attached event from the specified object. |
![]() ![]() | SetErrorTemplate(DependencyObject^, ControlTemplate^) | Sets the value of the ErrorTemplate attached property to the specified element. |
![]() ![]() | SetValidationAdornerSite(DependencyObject^, DependencyObject^) | Sets the ValidationAdornerSite attached property to the specified value on the specified element. |
![]() ![]() | SetValidationAdornerSiteFor(DependencyObject^, DependencyObject^) | Sets the ValidationAdornerSiteFor attached property to the specified value on the specified element. |
| Name | Description | |
|---|---|---|
![]() ![]() | ErrorEvent | Identifies the Error attached event. |
![]() ![]() | ErrorsProperty | Identifies the Errors attached property. |
![]() ![]() | ErrorTemplateProperty | Identifies the ErrorTemplate attached property. |
![]() ![]() | HasErrorProperty | Identifies the HasError attached property. |
![]() ![]() | ValidationAdornerSiteForProperty | Identifies the ValidationAdornerSiteFor attached property. |
![]() ![]() | ValidationAdornerSiteProperty | Identifies the ValidationAdornerSite attached property. |
| Name | Description | |
|---|---|---|
![]() ![]() | Error | Occurs when the bound element runs into a validation error, but only for bindings with the NotifyOnValidationError value set to true. |
For a detailed discussion of the validation process, see "Data Validation" in Data Binding Overview.
Available since 3.0
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




