In navigating between pages I see that there are functions letting you go back / forward or to the 'home' page. However, what I need is to be able to go back but skip over pages that the user shouldn't be able to visit any more. I searched around and found the following: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3819f389-3bfc-4c59-a919-272927fc9229
I tried using GetNavigationStack, but it keeps failing due to not being able to serialize and object I pass as the NavigationParameter. I'm having to use a Tuple to pass 2 parameters, but this can not be serialized and so I can not get the Navigation Stack to edit it and remove the pages manually.
I then found this WinRT - How to ignore or delete page from navigation history and thought I could include a boolean value that could be set if the page was to be skipped over
In LayoutAwarePage.cs
(the class all screens inherit from, generated by Visual Studio) I added protected bool CanGoBackToThisPage { get; set; }
which can be set if you don't want to visit this page, but there is also a problem with this as some times I wont know if you want to be able to visit a page again until you have done something on the current page. I don't think you can do something like previousFrame.CanGoBackToThisPage = true
. Also, the Frame
object you have access to doesn't (I think) have access to the actual page objects, but some summary object instead and I don't know how I'd go about getting this boolean into that summary object.
Does anyone know of a simple way to remove the previous / current page from the navigation stack? This seems like it would be a really common problem so I struggle to think Microsoft hasn't given us some way of doing it.
Thanks