This might be a trivial question for beginners, and I found quite a bit of information related to Windows and Silverlight applications, but nothing helped me. I am writing a Windows Phone 8.1 / WinRT application in C # and XAML, and I would like to programmatically modify the application panels created in XAML. For example, there is a button that I want to include only in debug builds using preprocessor directives in the code.
In the following XAML code, I create a BottomAppBar with two buttons. How to create a second button (AppBarAddSampleItemsButton), including all the properties in the code?
<prism:VisualStateAwarePage.BottomAppBar>
<CommandBar >
<CommandBar.PrimaryCommands>
<AppBarButton x:Uid="AppBarNewItemButton"
Label="New item"
Icon="Add" Command="{Binding GoToAddItemPageCommand}" />
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<AppBarButton x:Uid="AppBarAddSampleItemsButton"
Label="Add sample items"
Command="{Binding GoToAddSampleItemssPageCommand}" />
</CommandBar.SecondaryCommands>
</CommandBar>
</prism:VisualStateAwarePage.BottomAppBar>
source
share