简体   繁体   中英

How to navigate to specified panorama item from another page

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" ];
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM