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:


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 live online training, plus books, videos, and digital content from nearly 200 publishers.