title: WPF Stretch ListBox Height 100% of Grid.Row?
body: <p>I'm attempting to stretch the height of a <code>ListBox</code> 100% of the height of the parent grid (i.e. 90% of the height of the parent view); even if the <code>listboxes</code> are empty.  I should note that <code>VerticalAlignment="Stretch"</code> doesn't seem to work, so I've removed it from the <code>ListBox</code> and <code>StackPanel</code> elements.  As of now, the <code>ListBox</code> only stretches as far as it needs to in order to accommodate the number of items it contains.  I understand that the row definitions should work but if both lists are empty, they both shrink to a few pixels tall (along with the grid rows).  Could something cause these rows to shrink despite the explicit height declaration?</p>
  
  <pre><code>&lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width=".24*"/&gt;
          &lt;ColumnDefinition Width=".73*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height=".9*"/&gt;
          &lt;RowDefinition Height=".1*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;ListBox Grid.Column="0" Grid.Row="0" Name="Subdivisions" SelectedItem="{Binding SelectedSubdivisionViewModel}" ItemsSource="{Binding Path=Subdivisions}" Grid.IsSharedSizeScope="True"&gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel&gt;
                      &lt;Border BorderBrush="#FF4788c8" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"&gt;
                          &lt;Expander IsExpanded="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}"&gt;
                              &lt;Expander.Header&gt;
                                  &lt;StackPanel&gt;
                                      &lt;Grid&gt;
                                          &lt;Grid.ColumnDefinitions&gt;
                                              &lt;ColumnDefinition Width="*" SharedSizeGroup="col1" /&gt;
                                              &lt;ColumnDefinition Width=".1*" SharedSizeGroup="col2" /&gt;
                                              &lt;ColumnDefinition Width="*" SharedSizeGroup="col3" /&gt;
                                          &lt;/Grid.ColumnDefinitions&gt;
                                          &lt;Grid.RowDefinitions&gt;
                                              &lt;RowDefinition/&gt;
                                              &lt;RowDefinition/&gt;
                                          &lt;/Grid.RowDefinitions&gt;
                                          &lt;TextBlock Grid.Column="0" Grid.Row="0"&gt;
                                              &lt;TextBlock.Text&gt;
                                                  &lt;MultiBinding StringFormat="Name: {0}"&gt;
                                                    &lt;Binding Path="SubdivisionName" /&gt;
                                                    &lt;Binding Path="SubdivisionID" /&gt;
                                                  &lt;/MultiBinding&gt;
                                              &lt;/TextBlock.Text&gt;
                                          &lt;/TextBlock&gt;
                                          &lt;TextBlock Grid.Column="2" Grid.Row="0"&gt;
                                              &lt;TextBlock.Text&gt;
                                                  &lt;MultiBinding StringFormat="ID: {0}"&gt;
                                                    &lt;Binding Path="SubdivisionName" /&gt;
                                                    &lt;Binding Path="SubdivisionID" /&gt;
                                                  &lt;/MultiBinding&gt;
                                              &lt;/TextBlock.Text&gt;
                                          &lt;/TextBlock&gt;
                                          &lt;TextBlock Grid.Column="2" Grid.Row="1"&gt;
                                              &lt;TextBlock.Text&gt;
                                                  &lt;MultiBinding StringFormat="ID: {0}"&gt;
                                                    &lt;Binding Path="SubdivisionName" /&gt;
                                                    &lt;Binding Path="SubdivisionID" /&gt;
                                                  &lt;/MultiBinding&gt;
                                              &lt;/TextBlock.Text&gt;
                                          &lt;/TextBlock&gt;
                                      &lt;/Grid&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/Expander.Header&gt;
                              &lt;StackPanel&gt;
                                  &lt;Grid&gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition Width="*"/&gt;
                                          &lt;ColumnDefinition/&gt;
                                          &lt;ColumnDefinition/&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
                                      &lt;Grid.RowDefinitions&gt;
                                          &lt;RowDefinition /&gt;
                                          &lt;RowDefinition /&gt;
                                      &lt;/Grid.RowDefinitions&gt;
                                      &lt;TextBlock Text="{Binding ElementName=SubdivisionID}" /&gt;
                                      &lt;TextBlock Text="{Binding Path=SubdivisionID}" /&gt;
                                  &lt;/Grid&gt;
                              &lt;/StackPanel&gt;
                          &lt;/Expander&gt;
                      &lt;/Border&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
  </code></pre>