<UserControl x:Class="SilverlightApplication4.SilverlightControl1"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White" Margin="0,0,80,-20">
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="110,0,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="220,0,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="0,110,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="110,110,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="220,110,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="0,220,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="110,220,0,0"/>
<Grid HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Background="Beige" Margin="220,220,0,0"/>
</Grid>
</UserControl>
我已经在我的 xamp 文件中为 3*3 网格块编写了上述代码。我如何从后面的代码中做同样的事情而不是编写 9 行代码?