<DockPanel>
<TreeView DockPanel.Dock="Bottom" />
<DataGrid DockPanel.Dock="Bottom" Visibility="Collapsed"/>
</DockPanel>
Basically I want the first TreeView to fill the remaining space that the second DataGrid takes up when he's "collapsed".
And if I were to set the first TreeView to "Collapsed", I want the second one to grow in height when its set to Visible.
This doesnt work due to LastChildFill. But even if I set it to false, I cant get the elements to fit properly when one is collapsed. I cannot use a stackpanel here, as the stackpanel ignores free space entirely within the control, so it never fills my window!