How to Create ApplicationBar in Windows Phone using XAML ?

In one of the previous articles , we discussed how to create ApplicationBar programmatically during runtime using C# . This article will demonstrate how to create ApplicationBar using XAML.

How to Create ApplicationBar in Windows Phone using XAML ?

Below is a sample XAML code snippet which creates an ApplicationBar with one Menu Item and two ApplicationBarIconButton

<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem IsEnabled="True" Text="ABundantCode"/>
</shell:ApplicationBar.MenuItems>
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/add.png" IsEnabled="True" Text="Add"/>
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/cancel.png" IsEnabled="True" Text="Cancel"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>