Auto RowDefinitions Grid with ContentControls
I have a Page with two ContentC开发者_运维问答ontrols loaded by a RegionManager. A List of items, and a DetailView of these items. The problem is that the grid doesn't apply the auto height what I liked to. So I want to make all the available screen size to grid.row=0. I've added my code below:
<Grid>
<Grid.RowDefinitions>
<RowDefinition MinHeight="300" Height="Auto" />
<RowDefinition Height="200"/>
</Grid.RowDefinitions>
<ContentControl Grid.Row="0" x:Name="ListRegion" ListMededelingRegion}" IsTabStop="False" Focusable="False" Height="Auto" />
<ContentControl VerticalAlignment="Bottom" Grid.Row="1" x:Name="DetailRegion" cal:RegionManager.RegionName="{x:Static com:RegionNames.DetailRegion}" IsTabStop="False" Focusable="False" />
</Grid>
Auto
means "size to content" ; you need to specify *
to use all available height :
<Grid.RowDefinitions>
<RowDefinition MinHeight="300" Height="*" />
<RowDefinition Height="200"/>
</Grid.RowDefinitions>
精彩评论