title: WPF Grid layout panel with row height set to "Auto"
body: <p>I'd like to have a Grid with a row on the top and bottom with either labels or buttons in them.  In the middle I plan on using a ListBox.  I want the ListBox to expand to use all the available space.  It would be nice to not hard code the height of the other two rows.  My XAML is below.  How can I make the middle section expand automatically?  Thanks.</p>
  
  <pre><code>&lt;UserControl x:Class="WpfApplication1.UserControl1"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           mc:Ignorable="d" 
           d:DesignHeight="300" d:DesignWidth="300"&gt;
  &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition /&gt;
          &lt;ColumnDefinition /&gt;
          &lt;ColumnDefinition /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;Label Grid.Row="0"
             Grid.ColumnSpan="3"
             Content="Top Row" /&gt;
  
      &lt;ListBox Grid.Row="1"
               Grid.ColumnSpan="3" /&gt;
  
      &lt;Label Grid.Row="2"
             Grid.ColumnSpan="3"
             Content="Bottom Row" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>