弹指一挥间

好好做事,学习待人 (大数据分析/.NET/JAVA)技术交流QQ:860280456; .NET/JAVA技术交流群:192028174

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
 
1.页面传值:
 this.NavigationService.Navigate(new Uri("/SecondPage.xaml?CustomerId=1234&Product=555", UriKind.Relative));
 
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
 
            foreach (var item in NavigationContext.QueryString)
            {
                MessageBox.Show("Query String [" + item.Key + "] = " + item.Value);
            }
        }
 
或:
   this.NavigationService.Navigate(new Uri("/SecondPage.xaml#HelloWorld",
                                                    UriKind.Relative));
 
  Protected override void OnFragmentNavigation(System.Windows.Navigation.FragmentNavigationEventArgs e)
        {
            base.OnFragmentNavigation(e);
 
            MessageBox.Show("Fragment: " + e.Fragment);
        }
 
2.在非页面层调用页面跳转: 
       //跳转页面
      (Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame
      ).Navigate(new Uri("/MainPages/SecondPages/GameDetails.xaml", UriKind.Relative));
posted on 2014-06-18 22:17  v.e.n.u.s  阅读(1810)  评论(1编辑  收藏  举报