Validation.ErrorTemplate Attached Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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 attached property to a custom ControlTemplate.

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

Identifier field


Metadata properties set to true


Return to top