HasError Attached Property
Collapse the table of content
Expand the table of content

Validation.HasError Attached Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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:
© 2016 Microsoft