Validation.HasError Attached Property

May 11, 2014

Gets a value that indicates whether any binding on the target element has a validation error.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

See GetHasError
See Remarks

Property Value

Type: System.Boolean
true if any binding on the target element has a validation error; otherwise, false.

In Windows Phone, handlers for events, such as SizeChanged, can check any pending error state. Such event handlers might check for the Validation.HasError attached property on objects in code, but would either call the GetHasError method or call the GetValue method with the HasErrorProperty identifier.

Handlers for the BindingValidationError event typically change to a particular VisualState for validation as part of their logic.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft