【发布时间】:2013-01-11 20:31:57
【问题描述】:
我有MainPage.xaml 和PanoramaPage1.xaml。
如何在PanoramaPage 中从MainPage 导航到Item1 或Item2?
例如:
Button1->Item1 和 Button2->Item2
【问题讨论】:
标签: c# windows-phone-7 navigation panorama-control
我有MainPage.xaml 和PanoramaPage1.xaml。
如何在PanoramaPage 中从MainPage 导航到Item1 或Item2?
例如:
Button1->Item1 和 Button2->Item2
【问题讨论】:
标签: c# windows-phone-7 navigation panorama-control
您可以使用标准导航:
this.NavigationService.Navigate(new Uri("PanoramaPage1.xaml?buttonid=button1",UriKind.Relative));
在对象变量中传递您的目标,然后在全景页面中处理:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if ( this.NavigationContext.QueryString.ContainsKey( "buttonid" )
{
string buttonid = this.NavigationContext.QueryString[ "buttonid" ];
}
}
【讨论】:
if(parameter.Equals("1") NAVIGATE_TO_ITEM1; else NAVIGATE_TO_ITEM2;,但是如何导航到全景项目?