Wpf 带有ContentControls的自动行定义网格
我有一个由RegionManager加载的包含两个ContentControl的页面。项目列表以及这些项目的详细视图。问题是网格没有应用我喜欢的自动高度。所以我想将所有可用的屏幕大小设置为grid.row=0。我在下面添加了我的代码:Wpf 带有ContentControls的自动行定义网格,wpf,grid,contentcontrol,Wpf,Grid,Contentcontrol,我有一个由RegionManager加载的包含两个ContentControl的页面。项目列表以及这些项目的详细视图。问题是网格没有应用我喜欢的自动高度。所以我想将所有可用的屏幕大小设置为grid.row=0。我在下面添加了我的代码: <Grid> <Grid.RowDefinitions> <RowDefinition MinHeight="300" Height="Auto" /> <RowDefinition
<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
表示“大小与内容”;您需要指定*
以使用所有可用高度:
<Grid.RowDefinitions>
<RowDefinition MinHeight="300" Height="*" />
<RowDefinition Height="200"/>
</Grid.RowDefinitions>