windows-phone-7 – 导航到新页面而不将当前页面放在后台堆栈上
发布时间:2020-12-14 01:44:45 所属栏目:Windows 来源:网络整理
导读:在 Windows Phone 7应用程序中,我获得了一个CurrentPage,在特殊事件中,使用NavigationService导航到新页面: NavigationService.Navigate(new Uri("/NewPage.xaml",UriKind.Relative)); 现在,当用户单击NewPage时,我希望应用程序跳过CurrentPage并直接转到应
在
Windows Phone 7应用程序中,我获得了一个CurrentPage,在特殊事件中,使用NavigationService导航到新页面:
NavigationService.Navigate(new Uri("/NewPage.xaml",UriKind.Relative)); 现在,当用户单击NewPage时,我希望应用程序跳过CurrentPage并直接转到应用程序的MainPage. 我尝试使用NavigationService.RemoveBackEntry,但这会删除MainPage而不是CurrentPage. 如何在不将当前值放在后台堆栈的情况下导航到新页面?
导航到NewPage.xaml传递参数时,您知道何时从Backstack中删除上一页.
你可以这样做: 从CurrentPage.xaml导航到NewPage.xaml时,沿参数传递 bool remove = true; String removeParam = remove ? bool.TrueString : bool.FalseString; NavigationService.Navigate(new Uri("/NewPage.xaml?removePrevious="+removeParam,UriKind.Relative)); 在NewPage.xaml的OnNavigatedTo事件中,检查是否删除上一页. bool remove = false; if (NavigationContext.QueryString.ContainsKey("removePrevious")) { remove = ((string)NavigationContext.QueryString["removePrevious"]).Equals(bool.TrueString); NavigationContext.QueryString.Remove("removePrevious"); } if(remove) { NavigationService.RemoveBackEntry(); } 这样,如果要从Backstack中删除它,可以决定CurrentPage.xaml. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- winapi – 如何子类化win32控件并保持与旧版本的comctl32.d
- Windows中的C是否有简单的Program Files / Program Files(x
- IIS7在使用Windows身份验证时对某些用户来说很慢
- Windows openvpn客户端已连接但ip未更改
- windows – __deref_out_opt和__deref_opt_out之间有什么区
- windows-server-2008-r2 – 监视服务器上IOPS的实用程序
- Windows 2008 R2防火墙,允许被ping的设置方法
- 可以在XP上运行Qt 5.10程序吗?
- windows-server-2008-r2 – 可以在HyperV Windows VM的客户
- 最小滑动窗口
推荐文章
站长推荐
- 查看装在CrossOver中的windows程序的内部文件的方
- Windows 10 建立wifi热点
- windows-7 – 通过Windows命令行连接到gmail pop
- 在Windows 7 64位上从Delphi 7读取注??册表的问题
- windows – 如何阻止Internet Explorer跟踪在OTH
- Windows Server 2012 R2 Hyper-V PowerShell远端
- windows-7 – 如何从Windows 7 / Vista格式化为F
- Windows 安装 Anaconda3+PyCharm
- windows单机实现hbase、hive 整合
- 在.NET中调试外部DLL
热点阅读