Validation Members

Provides methods and attached properties that support data validation.

The Validation type exposes the following members.

  NameDescription
Public method Static member AddErrorHandler Adds an event handler for the Error attached event to the specified object.
Public method Static member ClearInvalid Removes all ValidationError objects from the specified BindingExpressionBase object.
Public method Static member GetErrors Gets the value of the Errors attached property of the specified element.
Public method Static member GetErrorTemplate Gets the value of the ErrorTemplate attached property of the specified element.
Public method Static member GetHasError Gets the value of the HasError attached property of the specified element.
Public method Static member GetValidationAdornerSite Gets the value of the ValidationAdornerSite attached property for the specified element.
Public method Static member GetValidationAdornerSiteFor Gets the value of the ValidationAdornerSiteFor attached property for the specified element.
Public method Static member MarkInvalid Marks the specified BindingExpression object as invalid with the specified ValidationError object.
Public method Static member RemoveErrorHandler Adds an event handler for the Error attached event from the specified object.
Public method Static member SetErrorTemplate Sets the value of the ErrorTemplate attached property to the specified element.
Public method Static member SetValidationAdornerSite Sets the ValidationAdornerSite attached property to the specified value on the specified element.
Public method Static member SetValidationAdornerSiteFor Sets the ValidationAdornerSiteFor attached property to the specified value on the specified element.
Top

  NameDescription
Public field Static member ErrorEvent Identifies the Error attached event.
Public field Static member ErrorsProperty Identifies the Errors attached property.
Public field Static member ErrorTemplateProperty Identifies the ErrorTemplate attached property.
Public field Static member HasErrorProperty Identifies the HasError attached property.
Public field Static member ValidationAdornerSiteForProperty Identifies the ValidationAdornerSiteFor attached property.
Public field Static member ValidationAdornerSiteProperty Identifies the ValidationAdornerSite attached property.
Top

  NameDescription
Public attached property Errors Gets the collection of all active ValidationError objects on the bound element.
Public attached property ErrorTemplate Gets or sets the ControlTemplate used to generate validation error feedback on the adorner layer.
Public attached property HasError Gets a value that indicates whether any binding on the binding target element has a ValidationError.
Public attached property ValidationAdornerSite Gets or sets the element that appears to indicate that a validation error occurred on the bound element where this property is set.
Public attached property ValidationAdornerSiteFor Gets or sets the element for which this element appears to indicate that an error occurred.
Top

  NameDescription
Public attached event Error Occurs when the bound element runs into a validation error, but only for bindings with the NotifyOnValidationError value set to true.
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft