我有一个 WPF 用户控件。它包含几个用 GridSplitter 分隔的扩展器。在下面的代码中,您可以看到第二个 Expander 包含一个 TabControl Items。其中一个选项卡有一个 DataGrid。我的问题是,当扩展器展开时,并非所有记录都适合 MaxHeight 200(参见下面的代码),滚动不可见。当我将 GridSplitter 移动到 Expander 下方时,它确实会出现,但是如果没有额外的操作,我怎样才能让它显示出来呢?
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="4"></RowDefinition>
<RowDefinition Height="Auto" MaxHeight="200"></RowDefinition>
<RowDefinition Height="4"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,3">
...
</StackPanel>
...
<Expander Grid.Row="2" IsExpanded="False" Header="Gathered File History">
...
</Expander>
<GridSplitter Grid.Row="3"
Height="4"
Background="Gray"
HorizontalAlignment="Stretch"></GridSplitter>
<Expander Grid.Row="4" IsExpanded="True" Header="Data Analysis: Detail Queries">
<TabControl x:Name="Items" >
...
</TabControl>
</Expander>
<GridSplitter Grid.Row="5"
Height="4"
Background="Gray"
HorizontalAlignment="Stretch"></GridSplitter>
<Expander Grid.Row="6" IsExpanded="True" Header="Source Detail Records">
...
</Expander>
</Grid>