I am writing my first application for Windows Phone 8.1. I use Visual Studio 2013 with Windows Phone 8.1 SDK Integration. The project type is “Windows Phone 8.1”. I want to use C# and XAML.
Currently it’s more about learning how this actually works and not so much about writing a real application.
I have trouble searching for sample code in general. To keep this question within the rules of stackoverflow let’s concentrate on the menu for the moment.
I want to have a simple menu with icons and labels at the bottom of a page. I found samples with CommandBar, phone:PhoneApplicationPage.ApplicationBar, Page.BottomAppBar and many others. Some are for Windows Phone 8, Windows Phone 8.1, Windows App, “Metro app /WinRT” or Universal App.
I don’t want to try many of these samples only to find out that they don’t work with Windows Phone 8.1 or that they will be replaced soon or that they work but the better alternative would be this or that.
Now my question: What is the recommended way to create a menu with some icons and labels at the bottom of the screen in Windows Phone 8.1?
Or more in general: What should I search for if I want to make sure that I search for code samples which are best for Windows Phone 8.1? I guess there are also lots of sample for Windows Phone 8 which still work in Windows Phone 8.1 but it is a headache to check every time if code which was ok for 8 still works for 8.1.
This is the code I usually use for menu in Windows Phone 8.1
<Page.BottomAppBar>
<CommandBar x:Name="appBar">
<CommandBar.PrimaryCommands>
<AppBarButton Icon="SomeIcon1" IsCompact="False" Label="SomeName1"/>
<AppBarButton Icon="SomeIcon2" IsCompact="False" Label="SomeName2"/>
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<AppBarButton Label="SomeLabel1"/>
<AppBarButton Label="SomeLabel2"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
CommandBar.PrimaryCommands are for buttons and CommandBar.SecondaryCommands are for labels.