CacheMode Property

UIElement.CacheMode Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets a value that indicates that rendered content should be cached when possible.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public CacheMode CacheMode { get; set; }

XAML Values


Exactly one BitmapCache object element, generally with the RenderAtScale attribute set. Technically, the XAML accepts any CacheMode object value, but BitmapCache is the only existing practical derived class in the Windows Phone core API.

Property Value

Type: System.Windows.Media.CacheMode
A value that indicates that rendered content should be cached when possible. If you specify a value of CacheMode, rendering operations from RenderTransform and Opacity execute on the graphics processing unit (GPU), if available. The default is null, which does not enable a cached composition mode.

Dependency property identifier field: CacheModeProperty

The XAML usage shown is the only practical available usage in Windows Phone core libraries. In theory, other CacheMode classes could be written to fill the CacheMode value, but these would be custom classes. See BitmapCache for the attributes you might set on the BitmapCache object element value.

Windows Phone has a different set of operations that can use GPU acceleration; for more information, see Essential graphics, visual indicators, and notifications for Windows Phone.

The following XAML uses a BitmapCache to set CacheMode for a MediaElement.

    <BitmapCache RenderAtScale="4"/>
  </ MediaElement.CacheMode>

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft