Page.NavigationCacheMode property

Applies to Windows and Windows Phone

Gets or sets the navigation mode that indicates whether this Page is cached, and the period of time that the cache entry should persist.

Syntax


public NavigationCacheMode NavigationCacheMode { get; set; }


<page NavigationCacheMode="navigationCacheModeMemberName" />

Property value

Type: NavigationCacheMode

A value of the enumeration. The default is Disabled.

Remarks

To enable a page to be cached, set NavigationCacheMode to either Enabled or Required. The difference in behavior is that Enabled might not be cached if the frame's cache size limit (CacheSize) is exceeded, whereas Required always generates an entry no matter the size limit.

If you want to change the value of NavigationCacheMode programmatically to Enabled or Required, you can only set these values in the constructor for the page.

If you change the value of NavigationCacheMode from Required or Enabled to Disabled, the page is flushed from the cache. The page is not simply marked as available to be flushed when the configured CacheSize is exceeded.

Examples

For example code that uses NavigationCacheMode, see Quickstart: Navigating between pages. For a complete sample that uses many of the Page and Frame features together, see XAML Navigation sample.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Page
Frame
Frame.CacheSize
NavigationCacheMode
Quickstart: Navigating between pages
XAML Navigation sample

 

 

Show:
© 2014 Microsoft