我有一个包含这些列和行定义的网格
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"
MinWidth="154" />
<ColumnDefinition Width="Auto"
MinWidth="175" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
在网格内部,我有一个 Listview,它有一个(gridview)。
<ListView Grid.Column="0"
Grid.Row="2"
Name="ListView"
ItemsSource=" {Binding MessageFields}"
Margin="10,12,0,-5"
Grid.ColumnSpan="3">
<ListView.View>
<GridView>
<GridViewColumn Width="100">
<GridViewColumnHeader Content="{StaticResource IdColumnContent}" />
</GridViewColumn>
<GridViewColumn Width="100">
<GridViewColumnHeader Content="{StaticResource CodeColumnContent}" />
</GridViewColumn>
<GridViewColumn Width="Auto">
<GridViewColumnHeader Content="{StaticResource NameColumnContent}" />
</GridViewColumn>
<GridViewColumn Width="100">
<GridViewColumnHeader Content="{StaticResource PositionColumnContent}" />
</GridViewColumn>
<GridViewColumn Width="100">
<GridViewColumnHeader Content="{StaticResource MappedListColumnContent}" />
</GridViewColumn>
<GridViewColumn>
<GridViewColumnHeader Content="{StaticResource MappingRuleColumnContent}" />
</GridViewColumn>
</GridView>
</ListView.View>
在网格内我也有一个 TreeView
<TreeView
Grid.Column="3" Grid.Row="2" ItemsSource="{Binding , Mode=TwoWay}">
当我最大化我的窗口时,我的树视图保持在它的位置,但根据窗口调整大小。但是我的 Listview 它随窗口扩展,但我的最后一列随窗口扩展,当我减小/恢复窗口大小时,它会缩小。如何使网格和树在窗口调整大小时适当拉伸?