AppBar in UWP

Step 1: First of all we've to create a Blank Universal Windows Platform Project in Visual Studio 2015.

Step 2: The next thing we'll do is to add the following code.It should be kept in mind that the AppBar code goes after the Grid.

  1. <Page.BottomAppBar>  
  2.     <CommandBar>  
  3.         <CommandBar.PrimaryCommands>  
  4.             <AppBarButton Name="webcamera" Icon="WebCam" Label="Camera" />  
  5.             <AppBarButton Name="user" Icon="AddFriend" Label="Add User" />  
  6.   
  7.         </CommandBar.PrimaryCommands>  
  8.   
  9.         <CommandBar.SecondaryCommands>  
  10.             <AppBarButton Name="webcamera" Icon="WebCam" Label="Camera" />  
  11.             </CommandBar.PrimaryCommands>  
  12.     </CommandBar>  
  13. </Page.BottomAppBar>  

Notice that there're two types of commands Primary Command and Secondary Command.

Primary Command is for our buttons and secondary command is for Menu.

Following diagram makes the concept clear.

Primary Commands

Secondary Command

Step 3:

Now Run your Project by simply pressing F5 simply enjoying AppBar Control in your application.

Ebook Download
View all
Learn
View all