title: WPF alignment stretch
body: <p>Can someone help me understand the WPF stretch alignment. I often run into issues where I want a control to fill an area but I never understand on what level I should put the VerticalAlignment="Stretch". Specially when UserControls are involved.</p>
  
  <p>I always solve the problem by trying different things or putting stretch on all levels but I would like to understand how to do it properly.</p>
  
  <p>Lets take the example I got now:</p>
  
  <ul>
  <li>I have a grid with a fixed size cell (which can be resized with a GridSplitter)</li>
  <li>In this cell I have a UserControl containing a StackPanel with a TabControl</li>
  <li>In the TabControl I have TabItems containing another UserControl with a ListView</li>
  </ul>
  
  <p>Or in some kind of pseudo XAML</p>
  
  <pre><code>&lt;ns:MyUserControl1 Grid.Row="0" Grid.Column="0"&gt;
      &lt;!-- this is in MyUserControl1 --&gt;
      &lt;StackPanel&gt;
          &lt;TabControl&gt;
              &lt;TabItem&gt;
                 &lt;ns:MyUserControl2&gt;
                      &lt;!-- This is in MyUserControl2 --&gt;
                      &lt;ListView/&gt;
                 &lt;/ns:MyUserControl2&gt;
              &lt;/TabItem&gt;
          &lt;/TabControl&gt;
      &lt;/StackPanel&gt;
  &lt;/ns:MyUserControl&gt;
  </code></pre>
  
  <p>Now I want the ListView to fill the entire grid cell (excluding the TabControl and margins of course).</p>