title: WPF- Validation -The validation error message goes behind the other controls because of AdornerDecorator
body: <p>I have implemented IDataErrorInfo in my ViewModel to return a string if the text box has error.</p>
  <pre><code>    public string this[string columnName]
      {
          get { return &quot;Error-- This is a long error message - sd&quot;; }
      }
  </code></pre>
  <p>But this error message goes behind the other control on the UI as shown below.</p>
  <p><img src="https://i.stack.imgur.com/92x0R.jpg" alt="alt text" /></p>
  <p>Below is the xaml:</p>
  <pre><code>&lt;Window x:Class=&quot;Test.Window1&quot;
          xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
          xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
          Title=&quot;Window1&quot; Height=&quot;600&quot; Width=&quot;600&quot;&gt;
  
  &lt;Window.Resources&gt;        
      
      &lt;ControlTemplate x:Key=&quot;validationTemplateNew&quot;&gt;
          &lt;DockPanel LastChildFill=&quot;True&quot;&gt;
              &lt;TextBlock Name=&quot;ErrorText&quot; DockPanel.Dock=&quot;Bottom&quot; Foreground=&quot;White&quot; Background=&quot;Red&quot; 
                                     FontSize=&quot;12&quot; Padding=&quot;2&quot; FontFamily=&quot;Trebuchet MS&quot; 
                                     Margin=&quot;5,5,0,0&quot;                                        
                                     TextWrapping=&quot;Wrap&quot;                                        
                                     Text=&quot;{Binding [0].ErrorContent}&quot; &gt;&lt;/TextBlock&gt;
              &lt;AdornedElementPlaceholder Name=&quot;ErrorTextBox&quot; /&gt;
          &lt;/DockPanel&gt;
      &lt;/ControlTemplate&gt;
      &lt;Style x:Key=&quot;ValidationStyle&quot; TargetType=&quot;{x:Type TextBox}&quot;&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property=&quot;Validation.HasError&quot; Value=&quot;True&quot;&gt;
                  &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;Red&quot; /&gt;
                  &lt;Setter Property=&quot;BitmapEffect&quot;&gt;
                      &lt;Setter.Value&gt;
                          &lt;BitmapEffectGroup&gt;
                              &lt;OuterGlowBitmapEffect GlowColor=&quot;Red&quot; GlowSize=&quot;3&quot; Noise=&quot;0.6&quot;&gt;&lt;/OuterGlowBitmapEffect&gt;
                          &lt;/BitmapEffectGroup&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;                    
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  
  &lt;Grid&gt;
      &lt;ItemsControl Name=&quot;ItemCtrl&quot;&gt;
  
          &lt;AdornerDecorator&gt;
              &lt;TextBox 
               FontSize=&quot;11&quot; 
               Margin=&quot;10&quot; 
               Width=&quot;250&quot;      
               VerticalAlignment=&quot;Center&quot;                                         
               Text=&quot;{Binding Path=StrText, ValidatesOnDataErrors=True, 
                      UpdateSourceTrigger=PropertyChanged}&quot; 
               Validation.ErrorTemplate=&quot;{StaticResource validationTemplateNew}&quot;
              Style=&quot;{StaticResource ValidationStyle}&quot;
               
               &gt;
              &lt;/TextBox&gt;
          &lt;/AdornerDecorator&gt;
          &lt;TextBox Width=&quot;250&quot; Text=&quot;ASDFASFASDFASDFASDFASDFASDF&quot;/&gt;
          &lt;TextBox Width=&quot;250&quot; Text=&quot;ASDFASFASDFASDFASDFASDFASDF&quot;/&gt;
          &lt;TextBox Width=&quot;250&quot; Text=&quot;ASDFASFASDFASDFASDFASDFASDF&quot;/&gt;
          &lt;TextBox Width=&quot;250&quot; Text=&quot;ASDFASFASDFASDFASDFASDFASDF&quot;/&gt;
          &lt;TextBox Width=&quot;250&quot; Text=&quot;ASDFASFASDFASDFASDFASDFASDF&quot;/&gt;
      &lt;/ItemsControl&gt;        
  &lt;/Grid&gt;
  
  &lt;/Window&gt;
  </code></pre>
  <p>Please let me know how to use AdornerDecorator such that the error message overlaps the other controls and doesn't go behind.</p>
  <p>My application is such that if I don't use AdornerDecorator, the error message is not displayed at all.</p>