title: Problems with using Controls.Popup as error adorner in WPF
body: <p>My (simplified) validation template is </p>
  
  <pre><code>&lt;Grid&gt;
    &lt;Border x:Name="ErrorAdorner" 
            BorderBrush="Red"&gt;
      &lt;AdornedElementPalceHolder /&gt;
    &lt;/Border&gt;
    &lt;Popup x:Name="ErrorPopup"
           PalcementTarget="{Binding ElementName=ErrorAdorner}"
           Placement="Bottom"
           StaysOpen="false"
           IsOpen="true"&gt;
      &lt;Grid&gt;
        &lt;TextBloxk Text="Error!!!" /&gt;
      &lt;/Grid&gt;
    &lt;/Popup&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>The adorned element is typically a textbox</p>
  
  <p>The problem I have with this approach is that, as soon as I click inside the textbox, the ErrorPopup disappears and the ErrorAdorner remains visible. Desired behavior is that both should stay visible.</p>
  
  <p>Things tried:</p>
  
  <ol>
  <li>Set StaysOpen to true on ErrorPopup. Problem: when you resize/move the parent window when the error is visible, the ErrorPopup remains at the same location, it doesnt move along with the textbox</li>
  <li>Use a StackPanel around the textbox (adorned element) and the error message text block. Problem: Popup comes with positioning capabilities ie., if there is not enough screen area below the textbox for the adorner, it automatically relocates it. But if a stack panel is used, error message just cuts off if there is no space or it changes the textbox layout(not desired)</li>
  </ol>
  
  <p>So in essence, I want to use the popup for its positional capabilities, but somehow want to fix the visibility problem</p>