Validation Validation Validation Validation Class

Definition

Provides methods and attached properties that support data validation.

public ref class Validation abstract sealed
public static class Validation
type Validation = class
Public Class Validation
Inheritance
ValidationValidationValidationValidation

Remarks

For a detailed discussion of the validation process, see "Data Validation" in Data Binding Overview.

Fields

ErrorEvent ErrorEvent ErrorEvent ErrorEvent

Identifies the Error attached event.

ErrorsProperty ErrorsProperty ErrorsProperty ErrorsProperty

Identifies the System.Windows.Controls.Validation.Errors attached property.

ErrorTemplateProperty ErrorTemplateProperty ErrorTemplateProperty ErrorTemplateProperty

Identifies the ErrorTemplate attached property.

HasErrorProperty HasErrorProperty HasErrorProperty HasErrorProperty

Identifies the System.Windows.Controls.Validation.HasError attached property.

ValidationAdornerSiteForProperty ValidationAdornerSiteForProperty ValidationAdornerSiteForProperty ValidationAdornerSiteForProperty

Identifies the ValidationAdornerSiteFor attached property.

ValidationAdornerSiteProperty ValidationAdornerSiteProperty ValidationAdornerSiteProperty ValidationAdornerSiteProperty

Identifies the ValidationAdornerSite attached property.

Attached Properties

ErrorTemplate ErrorTemplate ErrorTemplate ErrorTemplate

Gets or sets the ControlTemplate used to generate validation error feedback on the adorner layer.

ValidationAdornerSite ValidationAdornerSite ValidationAdornerSite 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 ValidationAdornerSiteFor ValidationAdornerSiteFor ValidationAdornerSiteFor

Gets or sets the element for which this element appears to indicate that an error occurred.

Methods

AddErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) AddErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) AddErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) AddErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>)

Adds an event handler for the Error attached event to the specified object.

ClearInvalid(BindingExpressionBase) ClearInvalid(BindingExpressionBase) ClearInvalid(BindingExpressionBase) ClearInvalid(BindingExpressionBase)

Removes all ValidationError objects from the specified BindingExpressionBase object.

GetErrors(DependencyObject) GetErrors(DependencyObject) GetErrors(DependencyObject) GetErrors(DependencyObject)

Gets the value of the System.Windows.Controls.Validation.Errors attached property of the specified element.

GetErrorTemplate(DependencyObject) GetErrorTemplate(DependencyObject) GetErrorTemplate(DependencyObject) GetErrorTemplate(DependencyObject)

Gets the value of the ErrorTemplate attached property of the specified element.

GetHasError(DependencyObject) GetHasError(DependencyObject) GetHasError(DependencyObject) GetHasError(DependencyObject)

Gets the value of the System.Windows.Controls.Validation.HasError attached property of the specified element.

GetValidationAdornerSite(DependencyObject) GetValidationAdornerSite(DependencyObject) GetValidationAdornerSite(DependencyObject) GetValidationAdornerSite(DependencyObject)

Gets the value of the ValidationAdornerSite attached property for the specified element.

GetValidationAdornerSiteFor(DependencyObject) GetValidationAdornerSiteFor(DependencyObject) GetValidationAdornerSiteFor(DependencyObject) GetValidationAdornerSiteFor(DependencyObject)

Gets the value of the ValidationAdornerSiteFor attached property for the specified element.

MarkInvalid(BindingExpressionBase, ValidationError) MarkInvalid(BindingExpressionBase, ValidationError) MarkInvalid(BindingExpressionBase, ValidationError) MarkInvalid(BindingExpressionBase, ValidationError)

Marks the specified BindingExpression object as invalid with the specified ValidationError object.

RemoveErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) RemoveErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) RemoveErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>) RemoveErrorHandler(DependencyObject, EventHandler<ValidationErrorEventArgs>)

Adds an event handler for the Error attached event from the specified object.

SetErrorTemplate(DependencyObject, ControlTemplate) SetErrorTemplate(DependencyObject, ControlTemplate) SetErrorTemplate(DependencyObject, ControlTemplate) SetErrorTemplate(DependencyObject, ControlTemplate)

Sets the value of the ErrorTemplate attached property to the specified element.

SetValidationAdornerSite(DependencyObject, DependencyObject) SetValidationAdornerSite(DependencyObject, DependencyObject) SetValidationAdornerSite(DependencyObject, DependencyObject) SetValidationAdornerSite(DependencyObject, DependencyObject)

Sets the ValidationAdornerSite attached property to the specified value on the specified element.

SetValidationAdornerSiteFor(DependencyObject, DependencyObject) SetValidationAdornerSiteFor(DependencyObject, DependencyObject) SetValidationAdornerSiteFor(DependencyObject, DependencyObject) SetValidationAdornerSiteFor(DependencyObject, DependencyObject)

Sets the ValidationAdornerSiteFor attached property to the specified value on the specified element.

Attached Events

Error Error Error Error

Occurs when the bound element runs into a validation error, but only for bindings with the NotifyOnValidationError value set to true.

Applies to

See Also