Changing Application Bar Icon Buttons on Different Pivot Items

Building a Windows Phone Application can be fun, but sometimes, certain small issues can make you jump here and there for a solution.
one of which is a common issue whereby you want the application to change the icons on the Application bar for a certain pivot item.

the easiest way for doing such is declaring two application bars as resources for your project with different icons in them and loading that particular application bar on the particular pivot Item of the application,

Read below for a complete step by step tutorial for this.

Step one :

Create a Pivot Item Page that has two Pivot Items in it. "PivotItem1" and "PivotItem2"


Step two:

on that particular Pivot Page, define two Application bars namely "myFirstAppbar" and "mySecondAppbar", rite before the "LayoutRoot" Grid.

Step three:

On the Pivot Control, create an event for the "SelectionChanged"

Right click the SelectionChanged event and click navigate to the Event Handler. it will take you to the Code Behind file for the Page.

write the Following code and you will be good to go.

Happy Developing 🙂

Comments (4)
  1. Hatem Kotb says:

    Thanks, that was helpful!

  2. John says:

    How about Windows Phone 8.1?

  3. Philipp says:

    An example for WIndows Phone 8.1 store app would be awesome!

  4. Shaheem says:

    Excellent explanation, works perfect.

    Thank you very much

Comments are closed.

Skip to main content