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.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
<uiElement> <uiElement.CacheMode> singleBitmapCache </uiElement.CacheMode> </uiElement>
XAML Values
Property Value
Type: System.Windows.Media.CacheModeA 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.
<MediaElement> <MediaElement.CacheMode> <BitmapCache RenderAtScale="4"/> </ MediaElement.CacheMode> </MediaElement>