我在我的网格中创建了一个 GridSplitter
,横跨了我拥有的三行,如下所示:
<GridSplitter Grid.Row="0" Grid.Column="1" Background="Yellow"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Width="Auto" Height="Auto" ResizeDirection="Columns"
Grid.RowSpan="3" ...
不过,我可能会在以后向我的网格中添加另一行,而我真的不想回去更新所有的行跨度。
我最初的猜测是Grid.RowSpan="*"
,但那样无法编译。
ColumnSpanProperty
和RowSpanProperty
应用Math.Min
函数,使它们与剩余列数或行数相比较。 - user7116<sys:Int32 x:Key="SpanAll">2147483647</sys:Int32>
和Grid.RowSpan="{StaticResource SpanAll}"
这样的代码片段来让其他人理解正在发生什么 :) - Fredrik Hedblad