title: WPF height and scroll at listbox - imposible
body: <p>To keep things simple all i am trying to do is to place a <code>listbox</code> and a button below it. Although it seems simple it isn't.  It is not, because it is in a GRID... </p>
  
  <p>The row size is star size and <code>listbox</code> having <code>verticalAlign</code> top works great all the time. The problem is that I cannot add a button below it. Having a grid with 2 rows one star height and the other auto would place the button at the bottom of the form even if <code>listbox</code> contents are little.  Trying to set both rows auto doesn't work when resizing as no scrollbar is visible at the <code>listbox</code>....  Any workaround for this??</p>
  
  <p>Update some code</p>
  
  <pre><code> &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*"  /&gt;
             &lt;RowDefinition Height="Auto" /&gt;
           &lt;/Grid.RowDefinitions&gt;
      &lt;DockPanel &gt;
  
         &lt;ListBox DockPanel.Dock="Top" Name="lbStaff"  ItemsSource="{Binding}"  
              Grid.Row="0" VerticalAlignment="Top" BorderThickness="0" 
                 Background="WhiteSmoke" Margin="15,10,20,30" Style="{DynamicResource 
                 ListBoxUsers}" ScrollViewer.VerticalScrollBarVisibility="Visible"&gt;
         &lt;ListBox.Resources&gt;
           &lt;Style  TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource 
              ListBoxTest1}"&gt;&lt;/Style&gt;
         &lt;/ListBox.Resources&gt;
           &lt;ListBox.ItemTemplate&gt;
               &lt;DataTemplate &gt;
                   &lt;StackPanel Margin="5,4,5,4"&gt;
                       &lt;TextBlock   HorizontalAlignment="Stretch"  FontSize="16"&gt;&lt;Run 
                       Text="{Binding Name}"/&gt; - &lt;Run Text="{Binding   Mode=OneWay, 
                       Path=PositionString}"/&gt;&lt;/TextBlock&gt;
                       &lt;TextBlock &gt;Τηλέφωνο &lt;Run Text="{Binding Phone}"/&gt;
                   &lt;/TextBlock&gt;
                   &lt;/StackPanel&gt;
  
               &lt;/DataTemplate&gt;
             &lt;/ListBox.ItemTemplate&gt;
    &lt;/ListBox&gt;
       &lt;Button DockPanel.Dock="Top" Grid.Row="0"   HorizontalAlignment="Right" 
         VerticalAlignment="Top"  Margin="0,10,7,0" Style="{DynamicResource 
          ButtonStyleNew1}"&gt;
         &lt;Button.Content&gt;
             &lt;StackPanel Orientation="Horizontal"&gt;
                 &lt;Image Source="/WpfApplication1;component/Images/filenew1.png" 
                 Stretch="None" VerticalAlignment="Center"&gt;&lt;/Image&gt;
                 &lt;TextBlock Margin="5,0,0,0" FontSize="16"&gt;Προσθήκη Χρήστη&lt;/TextBlock&gt;
            &lt;/StackPanel&gt;
        &lt;/Button.Content&gt;
       &lt;/Button&gt;
    &lt;/DockPanel&gt;                       
  
  &lt;/Grid&gt;
  
  &lt;/Grid&gt;
  </code></pre>