Using the ApplicationBar
Visual Studio provides you with a starting point by placing the markup for an ApplicationBar
in a comment block when you create a new Windows Phone Portrait Page, a Windows Phone Landscape Page, and various Windows Phone projects using the Add New Item and New Project dialogs.
The ApplicationBar
requires a namespace alias at the top of your page or control, as shown:
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
The markup for an ApplicationBar
element is placed in the page’s phone:PhoneApplicationPage
element. Placed within it are ApplicationBarIconButton
elements and a MenuItems
element containing ApplicationBarMenuItem
, as shown in the following example:
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.