1
我想用相同的控件填充所有單元格。我現在擁有的是一個控制模板和一個網格。但是我無法在Xaml中找到一種簡單的方法將控件添加到所有單元格中。用控件模板填充所有網格單元格
這是代碼,我現在所擁有的:
<Window x:Class="AcMidi.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="512" Width="760">
<Window.Resources>
<ControlTemplate x:Key="Planet">
<Button Content="Button"></Button>
</ControlTemplate>
</Window.Resources>
<Grid Height="209" Name="grid1" Width="500">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
</Grid>
</Window>