代码附上:(涉及到行列长宽,合并,表格线展示等基础属性设计,及一些常用控件页面布局,字体颜色渐变,显示方向等属性的定义)
<Grid x:Name="LayoutRoot" Background="White" >
<Grid Width="400" Height="300" ShowGridLines="False" Background="Gold">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition ></RowDefinition>
<RowDefinition Height="*" ></RowDefinition>
<RowDefinition Height="0.2*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="第一行第一列" Foreground="Red" ></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="第一行第二列"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="2" Text="第一行第三列"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="第二行第一列"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="第二行第二列"></TextBlock>
<TextBlock Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,20,0,26" Text="第三行跨2列 第三行跨2列第三行跨2列第三行跨2列">
<TextBlock.Foreground><LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="Black" Offset="0" />
<GradientStop Color="#FF5AF23E" Offset="1" />
</LinearGradientBrush>
</TextBlock.Foreground>
</TextBlock>
<TextBlock Grid.Row="1" Grid.RowSpan="2" Grid.Column="2" FontSize="9" Text="第三列 第三行并第二行"
FlowDirection="RightToLeft" Foreground="#FF2836DE">
</TextBlock>
<Button Grid.Row="3" Grid.ColumnSpan="3" Background="Purple" Content="第4行跨4列"></Button>
</Grid>
</Grid>
上效果图(有网格线、无网格线)