我正在尝试制作一个WPF用户控件,其中包括两个分组框和每个分组框中的两个ListView
。以下是用户控件的XAML代码:
<UserControl x:Class="TestGroupControl.TestGroupControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="500" Width="700" MinWidth="300" MinHeight="200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="225*" />
<RowDefinition Height="225*" />
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="Test Data" Margin="2,2,2,2" Name="testDataGroupBox">
<Grid>
<ListView Margin="2,2,2,2" Name="testDataListView" ></ListView>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Header="Test Parameters" Margin="2,2,2,2" Name="testParametersGroupBox">
<Grid>
<ListView Margin="2,2,2,2" Name="testParametersListView" ></ListView>
</Grid>
</GroupBox>
</Grid>
</UserControl>
我面临的问题是,当我尝试调整包含用户控件的主窗口大小时,用户控件不会跟随父窗口一起调整大小。欢迎提出任何想法,谢谢。