【发布时间】:2012-11-16 17:30:25
【问题描述】:
恐怕我在这里遗漏了一些简单的东西,但我正在尝试在我的应用栏中放置多个按钮。
这是初始应用栏的代码
<common:LayoutAwarePage.TopAppBar>
<AppBar HorizontalAlignment="Left">
<Button x:Name="resetButton" Content="Reset" HorizontalAlignment="Left" VerticalAlignment="Stretch" Click="resetButton_Click" />
</AppBar>
</common:LayoutAwarePage.TopAppBar>
现在这段代码有效,但我想添加第二个按钮。
我认为这很简单,我尝试了:
<common:LayoutAwarePage.TopAppBar>
<AppBar HorizontalAlignment="Left"> <!-- line 19 -->
<Button x:Name="resetButton" Content="Reset" HorizontalAlignment="Left" VerticalAlignment="Stretch" Click="resetButton_Click" />
<Button x:Name="newButton" Content="NewButton" /> <!-- line 21 -->
</AppBar>
</common:LayoutAwarePage.TopAppBar>
但我收到以下错误:
The property "Content" can only be set once. (line 19)
The property "Content" can only be set once. (line 21)
Duplication assignment to the 'Content' property of the 'AppBar' object (line 21)
我认为我可能缺少AppBar 控件的某些内容。我如何在其中放置第二个按钮?
【问题讨论】: