Search code examples
c#windows-phone-7navigationpanorama-control

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


Solution

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