【发布时间】:2014-01-22 10:11:08
【问题描述】:
我有 2 个主要列,由 gridsplitter 分隔:
<Window x:Class="EnvironmentNet.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:caliburn="http://www.caliburnproject.org"
Width="800"
Height="400"
Background="Black"
ResizeMode="CanResizeWithGrip"
>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*" MinWidth="300" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="0.8*" MinWidth="400" />
</Grid.ColumnDefinitions>
<Grid Background="Red" x:Name="Nav" Grid.Column="0" />
<GridSplitter HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="5" Grid.Column="1" />
<Grid Background="Green" x:Name="Content" Grid.Column="2" />
</Grid>
</Window>
这很好用,但是当我调整窗口大小时,左列也开始调整大小。调整窗口大小时,如何使左列保持固定宽度并使右列伸展?用户应该仍然可以使用 gridsplitter 手动调整左右列的大小。
谢谢
【问题讨论】: