I'm afraid that I'm missing something simple here, but I'm trying to put a few buttons in the application bar.
here is the code for the initial application panel
<common:LayoutAwarePage.TopAppBar> <AppBar HorizontalAlignment="Left"> <Button x:Name="resetButton" Content="Reset" HorizontalAlignment="Left" VerticalAlignment="Stretch" Click="resetButton_Click" /> </AppBar> </common:LayoutAwarePage.TopAppBar>
Now this code works, but I want to add a second button.
I thought it would be pretty simple to do, I tried:
<common:LayoutAwarePage.TopAppBar> <AppBar HorizontalAlignment="Left"> <Button x:Name="resetButton" Content="Reset" HorizontalAlignment="Left" VerticalAlignment="Stretch" Click="resetButton_Click" /> <Button x:Name="newButton" Content="NewButton" /> </AppBar> </common:LayoutAwarePage.TopAppBar>
but I get the following errors:
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)
I think there might be something in the AppBar control that I am missing. How do I insert a second button into it?
source share