This topic has not yet been rated - Rate this topic

Validation.HasError Attached Property

May 02, 2013

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.0, 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.