locked
is it possible to navigate from a portrait to a particular pivot in a pivot template RRS feed

  • Question



  • im currently using

    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));





    mainpage has 4 pivots

    can i navigate to mainpage and land on a different pivot for example piviot 2 ???
    Thursday, December 23, 2010 10:39 PM

Answers

  • Hi,

     You can use Pivot.SelectedIndex to get and set the current pivot. So, in your case, you would use myPivot.SelectedIndex = 1 (because it's zero based, so pivot item 1 has an index of 0). You can put this code in your OnNavigatedTo method of MainPage. If you only want to do it sometimes, you could pass in a querystring that contains the index value you want to jump to. In your MainPage's OnNavigatedTo method, simply check the querystring, cast it to an int and set your Pivot.SelectedIndex property to that value.
    Thursday, December 23, 2010 11:24 PM