Working with Windows Phone Application Bar Menu Items

Application Bar and Menu Items

Hello Guys! Today we will be dealing with Application Bar Menu Items. You will see some application like emailing apps that contain below some of the option like to forward the mail or share it on Social Circle and etc. Below that you would find some other options too and those options can be added from Menu Items.

Let’s get started with Application Bar Menu Items:

  • First of all Click the Document Outline tab that is present beside the Solution Explorer tab. If you can find the Document Outline tab press CTRL + ALT + T and you will see a new Windows will pop up which is named as Document Outline.
    Application Bar Menu Items
  • After that Click on Application Bar go to its properties. There you will see a Tab as Application click it. Change the background to White and foreground to black.
    Application Bar Menu Items
  • Click on the Button menu that is on the right and then a new Windows will pop up.  Click Add select IconUri select the desire icon and then name it.
    Application bar Menu Items
  • This was a way to add a Application Bar now lets see how to add Menu Bar.
  • Be on the same properties menu and below button where we clicked to add button on Application bar you will find Menu Items. And don’t forget to tick check the IsMenuEnabled checkbox.Application bar Menu Items
  • After that click on the Menu Item and add a Menu Item option.
    Application bar Menu Items
  • Here you will notice you just have to add text and that’s all
  • I have created in this case two Menu Items that is Find Directions and the other one is Locate Me.
  • As you will add these things you will be able to see xaml generating automatically on MainPage.xaml Page.
  • What if you want to add Click events for both Button and Menu Items?
  • That not a problem treat it like a button, go on its xaml and just write click and add event to it.
    Application bar Menu Items
  • Now the last thing you have to do is place your cursor on the name of event. Right Click it and Go to Definition. With this you event handler would be created. Or you can place the mouse and press F12.
    Application bar Menu Items

Get Sample Code from here