ErrorTemplate Attached Property

Validation.ErrorTemplate Attached Property


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

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

See GetErrorTemplate, SetErrorTemplate

Property Value

Type: System.Windows.Controls.ControlTemplate

The default template defines a red border around the element being adorned.

The WPF data binding model allows you to associate ValidationRules with your Binding object. If the user enters an invalid value, you may want to provide some feedback about the error on the application user interface (UI). One way to provide such feedback is to set the Validation.ErrorTemplate  to a custom ControlTemplate.GTMT

For a detailed discussion of validation, see the Data Validation section of the Data Binding Overview.

Identifier field


Metadata properties set to true


Legacy Code Example

Code snippet is not found. Confirm that the code snippet name 'HOWDOI' is correct.
Return to top
© 2015 Microsoft