adminSoftDK
adminSoftDK

Reputation: 2092

Universal Windows Platform Page KeepAlive

In Universal Windows Platform is there a way to keep page alive? So let’s say I am entering a new customer and at some point I realised that the category I want to assign has not been created, so I want to navigate to a different page to add that category but I don’t want the current page to be destroyed and loose the data. In WPF this scenario is very simple with PRISM KeepAlive.

Thank you

Upvotes: 0

Views: 739

Answers (1)

Stefan Over
Stefan Over

Reputation: 6046

You can cache a page and it's content by setting the NavigationCacheMode property. The default setting of this property is Disabled, so you have to set it manually in your constructor:

public MyPage()
{
    // The page will only be cached,
    // if the cache size of the parent Frame is large enough for this page
    NavigationCacheMode = NavigationCacheMode.Enabled;

    // The page will always be cached,
    // even if it exceeds the cache size of the parent Frame
    NavigationCacheMode = NavigationCacheMode.Required;
}

For further details, look into the Quickstart: Navigating between pages topic on MSDN.

Upvotes: 2

Related Questions