WP8——页面跳转方法
2024-10-19 22:37:12
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));
最新文章
- Spring boot mybatis项目启动后一直刷日志的bug修复……
- Java -- File
- hadoop MapReduce 工作机制
- linux第4天 shell socket
- php求文件的相对路径
- 跨平台c++ Coroutine,仿unity3d实现
- 在HTML文件中加载js
- 济南学习 Day 3 T1 am
- HDOJ(HDU) 2106 decimal system(进制相互转换问题)
- SQLServer 扫盲
- hello nodejs
- ios deprecated 警告消除 强迫症的选择
- JavaSE(十一)之异常处理详解
- python从零开始 -- 第0篇之Hello World!
- QPainter绘制遇到的小问题
- PAT基础6-1
- css sticker footer
- MFC (如何通过点击botton打开一个文件夹/文件)
- pbft流程深层分析和解释(转)
- android 登录效果