AdornedElementPlaceholder Class
Represents the element used in a ControlTemplate to specify where a decorated control is placed relative to other elements in the ControlTemplate.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Use this class only if you are creating a ControlTemplate that serves as a custom validation ErrorTemplate to provide visual feedback when the user input is not valid.
For example, you might want a red exclamation point to appear next to a text box when the input is not valid, as in the following illustration.

The following example shows how to use a ControlTemplate with AdornedElementPlaceholder to create the adorned TextBox in the preceding illustration.
<ControlTemplate x:Key="validationTemplate"> <DockPanel> <TextBlock Foreground="Red" FontSize="20">!</TextBlock> <AdornedElementPlaceholder/> </DockPanel> </ControlTemplate>
The AdornedElementPlaceholder element specifies where the control being adorned (the TextBox in this case) should be placed.
You can then specify your template as the ErrorTemplate for your TextBox, as in the following example.
<TextBox Name="StartDateEntryForm" Grid.Row="3" Grid.Column="1" Validation.ErrorTemplate="{StaticResource validationTemplate}" Style="{StaticResource textStyleTextBox}" Margin="8,5,0,5"> <TextBox.Text> <Binding Path="StartDate" UpdateSourceTrigger="PropertyChanged" Converter="{StaticResource dateConverter}" > <Binding.ValidationRules> <src:FutureDateRule /> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox>
For the complete sample, see Data Binding Demo or the Data Validation section in Data Binding Overview.
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.AdornedElementPlaceholder
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.