Reputation: 27
In my windows phone application one profile page is there.in this profile page profile,changepassword,orders and cash pivot items are there.
Whenever I click changepasswordbutton
then page will navigate from mainpage to profile page always go to profile pivot item only.
I want to go to changepassword pivotitem. How will solve this problem? please help me....
private void changepassword_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(profile));
}
Upvotes: 0
Views: 113
Reputation: 3502
Already answered by stack overflow for this question
Frame.Navigate(typeof(profile), 1);
In your profile page:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
MainPivot.SelectedIndex = (int) e.Parameter;
}
Hope this will help you..
Upvotes: 0
Reputation: 4298
You can set the pivot control's SelectedIndex
property to switch to a distinct pivot item within the page. For example, if changepassword is the third pivot item, you'd set
PivotControl.SelectedIndex = 2
If this shall be done directly after loading the page (e.g. because you just navigated to the page containing the pivot control), I'd run this code within the page's OnNavigatedTo
method.
Upvotes: 1