title: Can you have an expander do an overlay overtop of other visual tree elements in WPF?
body: <p>The problem is cosmetic more than a data problem. Is there a simple way to put element of </p>
  
  <pre><code>&lt;Expander&gt;(contents)&lt;/Expander&gt;
  </code></pre>
  
  <p>in a popup or something else to make it just overlay over top the other elements? </p>
  
  <p>XAML: (I just did a simple For loop to populate the binding of the 'Locs' in a ViewModel in the constructor, else most of the VM is blank)</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:MVVM"
          mc:Ignorable="d"
          Title="MainWindow" Height="600" Width="800"&gt;
    &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="Auto" /&gt;
        &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid&gt;
        &lt;Expander ExpandDirection="Down" IsExpanded="True" HorizontalAlignment="Stretch"&gt;
          &lt;Expander.Header&gt;
            &lt;TextBlock TextAlignment="Left" HorizontalAlignment="Center" VerticalAlignment="Center" Text="LOCATIONS" FontWeight="Bold"/&gt;
          &lt;/Expander.Header&gt;
          &lt;ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" Height="300" HorizontalAlignment="Stretch"&gt;
            &lt;ItemsControl ItemsSource="{Binding Locs}" &gt;
              &lt;ItemsControl.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                  &lt;CheckBox Margin="5" Content="{Binding}" /&gt;
                &lt;/DataTemplate&gt;
              &lt;/ItemsControl.ItemTemplate&gt;
            &lt;/ItemsControl&gt;
          &lt;/ScrollViewer&gt;
        &lt;/Expander&gt;
      &lt;/Grid&gt;
      &lt;Label Grid.Row="1" Height="100" Content="Test Content" FontSize="32" /&gt;
    &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Start of the Application and looks fine.  </p>
  
  <p><a href="https://i.stack.imgur.com/iUfRU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iUfRU.jpg" alt="Start of Control"></a></p>
  
  <p>Click the Expander and now it collapses, but it jumps text up.  I understand in the visual tree this is default behavior but <strong>is there a simple way to just wrap this in some overlay like a popup that does not make the other text jump when it collapses?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/z3sxc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z3sxc.jpg" alt="End of Control"></a></p>