I have MainPage.xaml and PanoramaPage1.xaml.

How can I navigate from MainPage to Item1 or Item2 in PanoramaPage?

For example: Button1->Item1 and Button2->Item2

有帮助吗?

解决方案

You can use a standard navitaion:

this.NavigationService.Navigate(new Uri("PanoramaPage1.xaml?buttonid=button1",UriKind.Relative));

Pass your target in object varible and then handle in panomarama page:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
  if ( this.NavigationContext.QueryString.ContainsKey( "buttonid" ) 
  {
      string buttonid = this.NavigationContext.QueryString[ "buttonid" ];
  }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top