我正在尝试使用统一网格来动态创建网格。但是,该类型UniformGrid
不存在于Microsoft.Toolkit.Uwp.UI.Controls
. 我已经为 UWP 更新了我的 NuGet,但它似乎仍然无法正常工作。这是我的代码:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ConwaysGameofLife"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<controls:UniformGrid>
<Border Background="AliceBlue" Grid.Row="1" Grid.Column="1">
<TextBlock Text="1"/>
</Border>
<Border Background="Cornsilk">
<TextBlock Text="2"/>
</Border>
<Border Background="DarkSalmon">
<TextBlock Text="3"/>
</Border>
<Border Background="Gainsboro">
<TextBlock Text="4"/>
</Border>
<Border Background="LightBlue">
<TextBlock Text="5"/>
</Border>
<Border Background="MediumAquamarine">
<TextBlock Text="6"/>
</Border>
<Border Background="MistyRose">
<TextBlock Text="7"/>
</Border>
</controls:UniformGrid>
</Page>
提前致谢。