0
我想能夠將大按鈕添加到我的ItemsControl。巨人按鈕應該包含在裏面多的TextBlocks畫布,像下面的XAML代碼的按鈕:在c中添加畫布和TextBlocks到巨大的按鈕#
<DockPanel>
<Button DockPanel.Dock="Right" Click="add_Click">Add</Button>
<ItemsControl Name="itemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Button Width="450" Height="150" Margin="5" Name="button1" Background="DarkGreen">
<Canvas>
<TextBlock Canvas.Right="80" Canvas.Bottom="30" Background="RoyalBlue" Width="60" TextAlignment="Center" Name="person1">OR1</TextBlock>
<TextBlock Canvas.Right="10" Canvas.Bottom="30" Background="SkyBlue" Width="60" TextAlignment="Center" Name="person2">Smith</TextBlock>
<TextBlock Canvas.Left="40" Canvas.Bottom="30" Background="Goldenrod" Width="60" TextAlignment="Center" Name="person3">CAM1</TextBlock>
<TextBlock Canvas.Left="110" Canvas.Bottom="30" Background="HotPink" Width="60" TextAlignment="Center" Name="person4">Doe</TextBlock>
</Canvas>
</Button>
</ItemsControl>
</DockPanel>
如何我在XAML在我的C#add_Click功能添加一個巨大的按鈕,像一個?我嘗試過在線搜索,但一直沒能找到任何可以實現類似的功能。