title: Dragging GridSplitter causes cell to grow when using Auto height/width
body: <p>I am using a GridSplitter to resize a cell in a grid however its behaviour is not what I am expecting and I cannot find a solution. It is a grid of three rows, the first has a row definition set to Auto and contains some elements. The second row has some data in it and has a row definition of * to fill the remaining space. The last row is a status bar that needs to be resizable, and so has a grid splitter in it and a row definition height of Auto and MinHeight of 30.</p>
  
  <p>The problem is when you drag the GridSplitter all the way to the top, it will make the cell overflow. I wish for it to STOP once it gets to the top. The desired behaviour can be achieved by removing the Height=Auto from the last row, but that makes the bottom cell expand to equal height with the middle row.</p>
  
  <p>Here is a XAML Pad example.</p>
  
  <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt;
      &lt;Grid ShowGridLines="True"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="*" MinHeight="20" /&gt;
              &lt;RowDefinition Height="Auto" MinHeight="30" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Grid.Row="0" Text="Foo" /&gt;
          &lt;TextBlock Grid.Row="1" Text="Bar" /&gt;
          &lt;GridSplitter  Canvas.ZIndex="1"  VerticalAlignment="Top"  Grid.Row="2" Background="Cyan" Height="5" HorizontalAlignment="Stretch"  /&gt;
          &lt;TextBlock VerticalAlignment="Bottom" Grid.Row="2" TextWrapping="Wrap"&gt;LOL&lt;LineBreak/&gt;LOL&lt;LineBreak/&gt;LOL&lt;/TextBlock&gt;
      &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>When you drag to the top, you will notice the bottom text disappears.</p>
  
  <p>I have tried various things, such as putting the grid splitter in its own cell, and Binding Height to another objects ActualHeight etc but none really work that well.</p>
  
  <p>I know it isn't the most well explained question, but any ideas would be greatly appreciated.</p>
  
  <p><strong>Edit:</strong>
  I have made the GridSplitter with its own row as posted below, but as I mentioned earlier the problem still remains. I have the ResizeBehavior and ResizeDirection also set here.</p>
  
  <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt;
      &lt;Grid ShowGridLines="True"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="*" MinHeight="20" /&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="Auto" MinHeight="30"  /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Grid.Row="0" Text="Foo" /&gt;
          &lt;TextBlock Grid.Row="1" Text="Bar" /&gt;
          &lt;GridSplitter ResizeDirection="Rows" ResizeBehavior="PreviousAndNext" Grid.Row="2" Background="Cyan" Height="5" HorizontalAlignment="Stretch"  /&gt;
          &lt;TextBlock VerticalAlignment="Bottom" Grid.Row="3" TextWrapping="Wrap"&gt;LOL&lt;LineBreak/&gt;LOL&lt;LineBreak/&gt;LOL&lt;/TextBlock&gt;
      &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>An example of what does work is removing the last rows Height="Auto" and changing it to * like so
              
                  
                  
                  
                  
              </p>
  
  <p>This however makes the last row equal in size to the row before it and not to the requested size of the cell.</p>