title: WinRT/UWP Frame and Page caching: How to create new page instance on Navigate() and keep the page instance on GoBack()
body: <p>I'm trying to create an UWP (Universal Windows App) application with C#. My problem is the <code>Frame</code> control: If I use it without <code>NavigationCacheMode = Required</code>, every time the user goes back, the page is not kept in memory and will be recreated. If I set <code>NavigationCacheMode</code> to <code>Required</code> or <code>Enabled</code>, going back works correctly (no new page object) <strong>but</strong> if I navigate to another page from the same type, the previous page object is recycled and reused (no new page instance). </p>
  
  <p><strong>Desired behavior:</strong></p>
  
  <p>Is there a way to have the following behaviour with the original <code>Frame</code> control (like in Windows Phone): </p>
  
  <ol>
  <li>Create new page instance on <code>Navigate()</code></li>
  <li>Keep the page instance on <code>GoBack()</code> </li>
  </ol>
  
  <p>The only solution I know is to create an own <code>Frame</code> control but this leads to other problems (e.g.: missing <code>SetNavigationState()</code> method, etc...)</p>
  
  <p><strong>Sample scenario:</strong></p>
  
  <p>Simple application example with three pages: <code>TvShowListPage</code>, <code>TvShowDetailsPage</code>, <code>SeasonDetailsPage</code>. </p>
  
  <ol>
  <li><code>TvShowListPage</code> is the entry page. After clicking on a <code>TvShow</code> navigate to <code>TvShowDetailsPage</code>. </li>
  <li>Now in <code>TvShowDetailsPage</code> select a season in the list and navigate to the <code>TvShowDetailsPage</code>. </li>
  <li>If navigating back, the pages should stay in memory to avoid reloading the pages. </li>
  <li>But if the users goes back to <code>TvShowListPage</code> and selects another <code>TvShow</code> the <code>TvShowDetailsPage</code> gets recycled and is maybe in the wrong state (eg showing the cast pivot instead of the first, seasons pivot)</li>
  </ol>
  
  <p>I'm looking for the default Windows Phone 7 behavior: Navigating creates a new page on the page stack, going back removes the top page from the stack and displays the previous page from the stack (stored in the memory). </p>
  
  <p><strong>Solution:</strong></p>
  
  <p>Because there was no solution to this problem, I had to reimplement all paging relevant classes: Page, Frame, SuspensionManager, etc... </p>
  
  <p>The <strong>library MyToolkit</strong> which provides all these classes can be downloaded here: <a href="https://github.com/MyToolkit/MyToolkit/wiki/Paging-Overview" rel="noreferrer">https://github.com/MyToolkit/MyToolkit/wiki/Paging-Overview</a></p>
  
  <p><strong>References:</strong></p>
  
  <ul>
  <li><a href="http://www.jayway.com/2012/05/25/clearing-the-windows-8-page-cache/" rel="noreferrer">http://www.jayway.com/2012/05/25/clearing-the-windows-8-page-cache/</a>: No good solution</li>
  <li><a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/88e6d1b3-1fa6-4ab4-a816-e77c86ef236f/" rel="noreferrer">http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/88e6d1b3-1fa6-4ab4-a816-e77c86ef236f/</a>: Implementing of an own Frame class is no solution as it doesn't work with <code>SuspensionManager</code></li>
  </ul>