wpf Grid布局
效果
GridDemo\GridDemo\MainWindow.xaml
<Window x:Class="GridDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GridDemo"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<!-- 👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇 -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition ></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition ></ColumnDefinition>
<ColumnDefinition ></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock FontSize="100" Text="00" Background="Pink" Grid.Row="0" Grid.Column="0" />
<TextBlock FontSize="100" Text="01" Background="Orange" Grid.Row="1" Grid.Column="0"/>
<TextBlock FontSize="100" Text="10" Background="Yellow" Grid.Row="0" Grid.Column="1" />
<TextBlock FontSize="100" Text="11" Background="Green" Grid.Row="1" Grid.Column="1"/>
</Grid>
</Window>