【发布时间】:2014-12-17 15:38:40
【问题描述】:
我(显然)是 WPF 的新手,并且正在努力弄清楚如何将 ListBox 放入 TabItem 中。我目前在下面的尝试导致Property 'Content' set more than once,所有我似乎与我无关的答案。
<Window>
<Grid>
<TabItem>
<Grid Background="Red"></Grid>
<TabItem.Header>
<DockPanel Width="130" HorizontalAlignment="Center">
<TextBlock Text="Inventory" Foreground="Black" FontSize="30" TextAlignment="Center"/>
</DockPanel>
</TabItem.Header>
<ListBox>
<ListBoxItem>Test</ListBoxItem>
</ListBox>
</TabItem>
</Grid>
</Window>
如果有人能指出我正确的方向,我将不胜感激。
【问题讨论】:
-
<Grid Background="Red"></Grid>有什么用?取下来看看。那应该可以。