Search code examples
c#.netwindows-phone-8windows-phone

how to navigate the particular pivot item in windows


In my windows application, I am using 4 pivot items for example cash,change password, items,profile. whenever i click the any pivot item the page navigate to profile pivot item only. But i need to go to particular pivot item only. Please any one help me out.

code:

private void changepassword_Click(object sender, RoutedEventArgs e)
        {
            //Frame.Navigate(typeof(profile), uuid);
            Frame.Navigate(typeof(profile));
        }

Solution

  • Navigate with pivot tab index as parameter

    Frame.Navigate(typeof(profile), 1)
    

    In your profile page:

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        MainPivot.SelectedIndex = (int) e.Parameter;
    }