WinRT的 - 如何忽略或从浏览历史中删除页面 [英] WinRT - How to ignore or delete page from navigation history

查看:138
本文介绍了WinRT的 - 如何忽略或从浏览历史中删除页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WinRT中的地铁(C# - XAML)以下场合应用:

I have following situation in my WinRT metro (c# - xaml) application :

用户启动应用程序,他或她没有登录在菜单栏我有按钮,它们定位到购物车。 。更何况,他们可以点击它,无论登录/退出状态是很重要的。

User launch the application and he or she is not logged in. In the menu bar I have button which navigates them to Shopping cart. It's important to mention that they can click on it regardless of logged in/out status.

所以我有这样的:

Home Page - > Login Page - > Shopping Cart

和一切都很正常,但是当我尝试按BACK按钮在我的购物车页我导航回的登录页,这是有意义的,因为网页是我的导航历史。但我不希望出现这种情况,我想用户返回到的首页并跳过登录页面。

And everything works great, but when I try press BACK button on my Shopping Cart page I'm navigated back to Login Page, which make sense, because page is in my navigation history. But I don't want that, I want to return user to Home Page and skip login page.

我的问题是如何做到这一点,以及如何操作上的WinRT框架导航堆栈。我试图要回两次,但没有运气。

My question is how to do that, and how to manipulate Frame Navigation Stack on WinRT. I tried with going Back twice, but with no luck.

顺便说一句,我的网页是LayoutAwarePage页面,我使用的NavigationService与此类似
< A HREF =http://dotnetbyexample.blogspot.com/2012/06/navigationservice-for-winrt.html> http://dotnetbyexample.blogspot.com/2012/06/navigationservice-for-winrt.html

Btw, my page is "LayoutAwarePage" page and I'm using NavigationService similar to this http://dotnetbyexample.blogspot.com/2012/06/navigationservice-for-winrt.html.

推荐答案

您可以接近它以不同的方式。你可以把它所以后面按钮多次导航回,直到到达主页或通过登录页面跳过。你也可以将登录页面的东西,导航之外展示了框架 - 无论是在一个弹出或在应用程序中的不同层

You can approach it in different ways. You can make it so the back button navigates back multiple times until it reaches the home page or skips through the log in page. You could also make the log in page something that shows up outside of the navigation Frame - either on a popup or in a different layer in the application.

*更新

在8.1平台的推出的 BackStack ForwardStack 在的框,您可以操控性能。

In 8.1 the platform introduced the BackStack and ForwardStack properties on the Frame which you can manipulate.

这篇关于WinRT的 - 如何忽略或从浏览历史中删除页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆