Page.NavigationCacheMode Page.NavigationCacheMode Page.NavigationCacheMode Page.NavigationCacheMode Property

Definition

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

public : NavigationCacheMode NavigationCacheMode { get; set; }
NavigationCacheMode NavigationCacheMode();

void NavigationCacheMode(NavigationCacheMode navigationcachemode);
public NavigationCacheMode NavigationCacheMode { get; set; }
Public ReadWrite Property NavigationCacheMode As NavigationCacheMode
<page NavigationCacheMode="navigationCacheModeMemberName" />

Property Value

A value of the enumeration. The default is Disabled.

Examples

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

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.

See also