title: Popup does not close when scrolling
body: <p>I have a textbox in which when it has focus a popup appears below it. But when the popup is open and I scroll, it appears to stay in the same spot where it was opened. I need help in figuring out how to have the popup appear below the textbox when I scroll. How would I do this in xaml?</p>
  
  <p>Thanks!</p>
  
  <p>MainWindow View:</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot"&gt;
      &lt;ScrollViewer&gt;
          &lt;local:ControlView/&gt;
  
      &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Resource Dictionary:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type Popup}"&gt;
      &lt;Style.Triggers&gt;
          &lt;DataTrigger Binding="{Binding ElementName=txtTest, Path=IsKeyboardFocused}" Value="True"&gt;
              &lt;Setter Property="IsOpen" Value="True" /&gt;
          &lt;/DataTrigger&gt;
          &lt;DataTrigger Binding="{Binding ElementName=txtTest, Path=IsKeyboardFocused }" Value="False"&gt;
              &lt;Setter Property="IsOpen" Value="False" /&gt;
          &lt;/DataTrigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  &lt;Style x:Key="BorderStyle" TargetType="{x:Type Border}"&gt;
      &lt;Setter Property="Background" Value="LemonChiffon"/&gt;
      &lt;Setter Property="Padding" Value="5"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>UserControl View:</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot"&gt;
          &lt;StackPanel Grid.Row="1" Grid.Column="4" Orientation="Vertical"&gt;
                           &lt;Button Content="Button" Width="100" Height="100"/&gt;
                           &lt;Button Content="Button" Width="100" Height="100"/&gt;
                           &lt;TextBox x:Name="txtTest" HorizontalAlignment="Stretch"/&gt;
  
                          &lt;Popup Name="TestPopup" StaysOpen="True"
                             PlacementTarget="{Binding ElementName=txtTest}"
                             AllowsTransparency="True" Placement="{Binding ElementName=txtTest}"&gt;
                              &lt;Border Style="{DynamicResource BorderStyle}"&gt;
                                  &lt;GroupBox Header="Test Popup"&gt;
                                      &lt;ScrollViewer Margin="0,2,0,0" VerticalScrollBarVisibility="Hidden"&gt;
                                       &lt;!--BINDING--&gt; 
                                       &lt;Label Content="Hello World!"/&gt;                             
                                      &lt;/ScrollViewer&gt;
                                  &lt;/GroupBox&gt;
                              &lt;/Border&gt;
                          &lt;/Popup&gt;
                          &lt;ContentPresenter Content="{Binding testBinding}"
                                            VerticalAlignment="Stretch" HorizontalAlignment="Stretch"&gt;
                          &lt;/ContentPresenter&gt;
                      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>