title: Pop pages off navigation stack in Windows 8 App
body: <p>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: <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3819f389-3bfc-4c59-a919-272927fc9229" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3819f389-3bfc-4c59-a919-272927fc9229</a></p>
  
  <p>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.</p>
  
  <p>I then found this <a href="https://stackoverflow.com/questions/12712562/winrt-how-to-ignore-or-delete-page-from-navigation-history">WinRT - How to ignore or delete page from navigation history</a> and thought I could include a boolean value that could be set if the page was to be skipped over</p>
  
  <p>In <code>LayoutAwarePage.cs</code> (the class all screens inherit from, generated by Visual Studio) I added <code>protected bool CanGoBackToThisPage { get; set; }</code> 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 <code>previousFrame.CanGoBackToThisPage = true</code>. Also, the <code>Frame</code> 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.</p>
  
  <p>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.</p>
  
  <p>Thanks</p>