Grid Row auto size priority
Hello,
I have a grid,
<Grid.RowDefinitions><RowDefinition Height="Auto" /><RowDefinition Height="Auto" /><RowDefinition Height="Auto" /> - contains ScrollViewer<RowDefinition /> - contains ListBox</Grid.RowDefinitions>and as I size the window to smaller and smaller heights, I see:
The first three rows have the same height all the time regardless the fact they do not fit into the window anymore.
The last row fills the remaining space, it gets smaller and smaller until it does not fit into the window, and then disappears.
What I need is to keep the last row height at some minimum. If it reaches that minimum, I'd like the third row to begin shrinking. If even that one does not fit any more into the window, let the remaining rows to be cropped as usual. My idea results in only the last row being visible in extremely small sizes.
However, it is not that easy. If I set MinHeight="100" to the last row definition (or to the ListBox), it indeed has fixed height of 100 when there is a little space remaining, but since the preivous rows heights are also fixed - Auto, further shrinking of the window causes the ListBox to be cropped.
This should express the behaviour I want:
<Grid.RowDefinitions>
<RowDefinition MinHeight="0" StandardHeight="Auto"MaxHeight="Auto" /><RowDefinition MinHeight="0" StandardHeight="Auto"MaxHeight="Auto" />
<RowDefinition MinHeight="0" StandardHeight="Auto"MaxHeight="* - 100" /> - contains ScrollViewer
<RowDefinition MinHeight="100" StandardHeight="*"MaxHeight="Infinite" /> - contains ListBox
</Grid.RowDefinitions>
How to achieve this?

