Reputation: 1380
Say I've got two elements in a window.
I'd like element A to fill all unused vertcial space and have always at least eg. 200px height.
Element B will have few fixed sizes (expander) and it should be given the space it demands (but leaving at least 200px for A). If there is not enough free space in a window, B should be scrollable.
That's close to what I wan't to achive, but DockPanel doesn't respect MinHeight property.
<DockPanel>
<ScrollViewer DockPanel.Dock="Bottom">
<B/>
</ScrollViewer>
<A MinHeight="200"/>
</DockPanel>
Is there any way to do it using WPF native panels?
Upvotes: 0
Views: 256
Reputation: 16464
A DockPanel will always process the panels in the order they are defined in; it won't make a docked element smaller just because the last element has a MinHeight.
I would use a Grid:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="200" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<A Grid.Row="0"/>
<ScrollViewer Grid.Row="1">
<B/>
</ScrollViewer>
</Grid>
Upvotes: 2