【发布时间】:2018-11-23 16:05:26
【问题描述】:
我在 UWP 中使用 microsoft 工具包并有类似的东西
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="3"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
</Grid>
<Grid Grid.Row="1">
<controls:GridSplitter ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
</Grid>
</Grid>
我如何才能将拆分器的喜爱设置为仅列 1 的人?我不想像第 1 列那样调整第 0 列的大小。就像在图像中一样,当我使用拆分器时,我只希望拆分器调整第 1 列的大小,第 0 列只是冻结。
新代码:
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="3"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="Red"></Grid>
</Grid>
<Grid Grid.Row="1">
<controls:GridSplitter GripperCursor="Help" HorizontalAlignment="Stretch" Grid.Column="1" ResizeDirection="Columns"
ResizeBehavior="CurrentAndNext" CursorBehavior="ChangeOnSplitterHover" VerticalAlignment="Stretch" ></controls:GridSplitter>
</Grid>
<Grid Grid.Row="2">
<TextBlock Text="aoisdjaisodjaiosdjsa" Width="60" Height="60" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</Grid>
</Grid>
【问题讨论】:
标签: c# uwp gridsplitter