This example uses my previous InkPresenter example to add an Application Bar to replace the undo and redo buttons with two ApplicationBarIconButton. I also add MenuItems to the application bar for illustrative purposes. As yet they serve no functional purpose.
- Add a reference to “Microsoft.Phone.Shell”
- In your page Add a namespace declaration with prefix of shell:
- Add images to your project either and ensure that you set the Copy to Output Directory as Always and Build Action as Content
- Add your application bar
- Wire up the event handlers
- Results
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone.Shell"
<phoneNavigation:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar Visible="True" IsMenuEnabled="True"> <shell:ApplicationBar.Buttons> <shell:ApplicationBarIconButton x:Name="btnUndo" IconUri="/Images/light/appbar.minus.rest.png" Click="btnUndo_Click"></shell:ApplicationBarIconButton> <shell:ApplicationBarIconButton x:Name="btnRedo" IconUri="/Images/light/appbar.add.rest.png" Click="btnRedo_Click" ></shell:ApplicationBarIconButton> </shell:ApplicationBar.Buttons> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem x:Name="mnuItemX" Text="Menu Item X"></shell:ApplicationBarMenuItem> <shell:ApplicationBarMenuItem x:Name="mnuItemY" Text="Menu Item Y"></shell:ApplicationBarMenuItem> </shell:ApplicationBar.MenuItems> </shell:ApplicationBar> </phoneNavigation:PhoneApplicationPage.ApplicationBar> </phoneNavigation:PhoneApplicationPage>
private void btnUndo_Click(object sender, EventArgs e)
{
_vm.Undo();
}
private void btnRedo_Click(object sender, EventArgs e)
{
_vm.Redo();
}
Some useful resources for the Application Bar are as follows:



Nice Post!
Thx 4 the info,
Catto