How do I make a button go to a specific PivotItem on a PivotPage

206 Views Asked by At

I am making a Windows Phone 8 app.

I have a Panorama page in which I have 6 buttons (main.xaml). I created a new page (extras.xaml) within the same project which has 6 PivotItems. When I click Button 1 in panorama page it should go to the first pivot item in pivot page and when I click button 2 in panorama page it should go to the second pivot item in pivot page. I have been primarily developing in VB.

1

There are 1 best solutions below

0
On

You should use navigation parameters when navigating to extras.xaml. For button one set pivotItem (for example) to 1, for button two set it to 2 and go on. To set a variable basically add it to your navigation URI (so extras.xaml becomes extras.xaml?pivotItem=1).

You may check out Navigation Context on MSDN to learn about handling in on extras.xaml.