WPF Grid - Auto-sizing with minimum height constraints
<h3>Background</h3>

<p>I need a grid with the following layout properties:</p>

<ol>
<li>4 rows: header, main content, sub-content, footer</li>
<li>The header is static content which isn't really affected by resize</li>
<li>The main content needs to fill up all available space, with a minimum height of 180</li>
<li>The sub-content is a RTB that can shrink and grow. This sub-content can eat up some of the main-contents space, but should always leave 180 pixels for the main-content. The sub-content should ideally only take up the minimum amount of area it needs. If there isn't much room left in the grid, the RTB should stop growing and instead enable its internal scrollviewer.</li>
<li>The footer is like the header, static content unaffected by resize</li>
</ol>

<h3>The problem</h3>

<p>The sub-content (<code>RTB</code>) isn't auto-sizing itself to fit within the remaining space, nor is the vertical scroll-bar being enabled. This is causing anything below the main content to clip outside of the window.</p>

<h3>Question</h3>

<p>How can I get the <code>RichTextBox</code> to shrink so that the footer is shown, allowing the user to scroll through the hidden <code>RichTextBox</code> content, while simultaneously allowing the <code>RichTextBox</code> to expand if the user stretches the window?</p>

<p><em>Below you will find a SSCCE which demonstrates what I'm trying to achieve and the issues that it's causing</em>:</p>

<pre><code>&lt;Window x:Class="WpfApplication2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        MinWidth="200" MinHeight="300" Width="200" Height="300"&gt;

    &lt;Grid&gt;

        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="Auto"/&gt;
            &lt;RowDefinition Height="*" MinHeight="180"/&gt;
            &lt;RowDefinition Height="Auto"/&gt;
            &lt;RowDefinition Height="10"/&gt;
        &lt;/Grid.RowDefinitions&gt;

        &lt;TextBlock Grid.Row="0" Text="Header" HorizontalAlignment="Center"/&gt;

        &lt;Rectangle Grid.Row="1" Fill="Red"/&gt;

        &lt;RichTextBox Grid.Row="2"
                     VerticalScrollBarVisibility="Visible"
                     Height="Auto"
                     Margin="0,5,0,0"
                     VerticalAlignment="Stretch"
                     BorderBrush="#FF818181"
                     BorderThickness="0.5"
                     Background="#FFEEEEEE"
                     FontSize="14"&gt;
            &lt;FlowDocument&gt;
                &lt;List&gt;
                    &lt;ListItem&gt;
                        &lt;Paragraph&gt;Lorem&lt;/Paragraph&gt;
                        &lt;Paragraph&gt;IpSum&lt;/Paragraph&gt;
                        &lt;Paragraph&gt;Lorem&lt;/Paragraph&gt;
                        &lt;Paragraph&gt;IpSum&lt;/Paragraph&gt;
                    &lt;/ListItem&gt;
                &lt;/List&gt;
            &lt;/FlowDocument&gt;
        &lt;/RichTextBox&gt;

        &lt;TextBlock Grid.Row="3" Text="Footer" HorizontalAlignment="Center"/&gt;

    &lt;/Grid&gt;
&lt;/Window&gt;
</code></pre>

<h3>Here is an image of the window when it's at its minimum size:</h3>

<p><a href="https://i.stack.imgur.com/Hnq3C.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hnq3C.jpg" alt="enter image description here"></a></p>

<h3>Here is an image of the window when it has been stretched to show all:</h3>

<p><a href="https://i.stack.imgur.com/ZDYbD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZDYbD.jpg" alt="enter image description here"></a></p>

<h3>Extra information</h3>

<p>I know that if I set the sub-content <code>RowDefinition</code> to <code>*</code> then the <code>RichTextBox</code> works fine, <strong>except</strong> for the fact it takes too much room when the window is expanded. I need this area to take as much room as <code>Auto</code> while behaving like <code>*</code>.</p>