AppBar on WP7.5 Panorama Page

I am currently developing a Windows Phone 7.5 app with a panoramic page.
On the panorama page, I implement the application panel to deal with several things in the application, such as displaying the location of the phone on a Bing map that is on one of the panel pages.

Now I believe that I have two options, but I don’t know how they will work (if they even work ...):

  • Show only icons in the application panel related to the current page / element
  • If you are not on the corresponding page / element, redirect to the page / element by clicking the application icon.

Will any of them work? Can I set an identifier for each of the panoramic elements, and then do 1 or 2 to work?

Thanks:)

+4
source share
1 answer

Both options can be performed.

To display only the app bar icons relevant to the page , you can use the Panorama.SelectionChanged event:

var currentPanormaItem = ((Panorama)sender).SelectedItem if(currentPanormaItem.Equals(firstPageItem)) { // Set AppBar icons for first page } else if(currentPanormaItem.Equals(secondPageItem)) { // Set AppBar icons for secondpage } 

If you know which panorama item is selected, you can set the application panel icon accordingly.

Changing the selected Panorama item can be done as follows:

 panoramaControl.DefaultItem = panoramaControl.Items[indexToSet]; 

Although changing the selected Panorama index is possible, I would suggest using the Pivot element. Using the Pivot element is easier to track the selected element, and you get a nice animation when you programmatically switch the selected page.

+5
source

All Articles