Is there a way to indicate which rotation element to move on the dashboard?

I know how to navigate from one rotation element to another, on a summary page, but what if navigation starts from another page entirely?

UPDATE:

Here is the solution I used based on Matt Lacy's answer:

From the button click event on MainPage:

private void button_Click(object sender, RoutedEventArgs e) { string parameter = "myPivotItem1"; NavigationService.Navigate(new Uri(string.Format("/MyPivotPage.xaml?parameter={0}", parameter), UriKind.Relative)); } 

Overrode OnNavigatedTo for the dashboard and query retrieval:

 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string newparameter = this.NavigationContext.QueryString["parameter"]; if (newparameter.Equals("myPivotItem1")) { myPivotControl.SelectedItem = myPivotItem1; } else if (newparameter.Equals("myPivotItem2")) { myPivotControl.SelectedItem = myPivotItem2; } } 
+4
source share
1 answer

You can set SelectedIndex to the index of the desired item.

Be careful with the delay in loading the item.

Update:
On the first page, pass the indicator from which pivotItem will be displayed in the request ** of the page you are going to.
In the OnNavigatedTo event on the page containing the pivot point, create a handler for the Loaded Pivot event and use this to set SelectedIndex.

** Other ways to do this are available.

+1
source

All Articles