Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
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)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

See GetErrorTemplate, SetErrorTemplate
<object Validation.ErrorTemplate="ControlTemplate" .../>

Property Value

Type: System.Windows.Controls.ControlTemplate
The default template defines a red border around the element being adorned.

Identifier field


Metadata properties set to true


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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft