Partager via


Frame.CacheSize Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the number of pages that can be cached for the frame.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Navigation (in System.Windows.Controls.Navigation.dll)

Syntax

'Declaration
Public Property CacheSize As Integer
public int CacheSize { get; set; }
<sdk:Frame CacheSize="int"/>

Property Value

Type: System.Int32
The number of pages that can be cached for the frame. The default value is 10.

Remarks

Dependency property identifier field: CacheSizeProperty

You set the CacheSize property to specify how many pages can be retained in a cache. When a page is cached, an instance of the page is reused for each navigation request rather than re-creating the page for each request.

The CacheSize property is only used when you set the NavigationCacheMode property of the Page class to Enabled. If you set the NavigationCacheMode property to Required, the page is cached regardless of the number of cached pages specified in the CacheSize property. Pages marked as Required do not count against the CacheSize total.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.