title: How to make items in a DockPanel expand to fit all available space in WPF?
body: <p>I have a <code>StackPanel</code> containing a <code>StackPanel</code> and some other items. The first <code>StackPanel</code> has a vertical orientation, the the inner one has a horizontal orientation. The inner one has a <code>TreeView</code> and a <code>ListView</code>, I would like them to expand and fit the width of the window, which I set by the window and allow the user to change. I would also like the outer <code>StackPanel</code> to fit the height of the window. How do I do this?</p>
  
  <p><strong>Edit:</strong>
  I've converted to using a <code>DockPanel</code>, and I've set the <code>DockPanel.Dock</code> properties correctly in each of the elements, and have disabled <code>LastChildFill</code> in both of the dockpanels, the layout still does not stretch.</p>
  
  <p>The Code:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Window x:Class="Clippy.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="400" Width="600" MinHeight="400" MinWidth="600" Loaded="Window_Loaded" SizeChanged="Window_SizeChanged"&gt;
      &lt;DockPanel Name="wrapperDockPanel" LastChildFill="False"&gt;
          &lt;Menu Height="22" Name="mainMenu" Width="Auto" DockPanel.Dock="Top" /&gt;
          &lt;ToolBar Height="26" Name="mainToolBar" Width="Auto" DockPanel.Dock="Top" /&gt;
          &lt;DockPanel Height="Auto" Name="contentDockPanel" DockPanel.Dock="Top" LastChildFill="False"&gt;
              &lt;TreeView Name="categoryTreeView" /&gt;
              &lt;ListView Name="clipListView" /&gt;
          &lt;/DockPanel&gt;
          &lt;StatusBar Height="23" Name="mainStatusBar" DockPanel.Dock="Top" /&gt;
      &lt;/DockPanel&gt;
  &lt;/Window&gt;
  </code></pre>