title: Error Template Design
body: <p>It seems like I read another question / answer on this site about this issue but I cannot recall what the answer was and now I cannot find the original post.</p>
  
  <p>I am not a fan of the default error template in WPF.  I understand how to change this error template.  However, if I add some content to the end of, say, a textbox, the size of the textbox does not change and the added content will (potentially) get clipped.  How do I alter the textbox (I believe the correct termonology is adorned element) in this scenario so that nothing gets clipped?</p>
  
  <p>Here is the XAML for the error template:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type TextBox}"&gt;
    &lt;Setter Property="Validation.ErrorTemplate"&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate&gt;
          &lt;StackPanel&gt;
            &lt;AdornedElementPlaceholder /&gt;
            &lt;TextBlock Foreground="Red" Text="Error..." /&gt;
          &lt;/StackPanel&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Here is the XAML for a couple of textboxes in the form:</p>
  
  <pre><code>&lt;StackPanel&gt;
    &lt;TextBox Text="{Binding...}" /&gt;
    &lt;TextBox /&gt;
  &lt;/StackPanel&gt;
  </code></pre>