BitmapImage::CacheOption Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the BitmapCacheOption to use for this instance of BitmapImage.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

property BitmapCacheOption CacheOption {
	BitmapCacheOption get();
	void set(BitmapCacheOption value);

Set the CacheOption to BitmapCacheOption::OnLoad if you wish to close a stream used to create the BitmapImage. The default OnDemand cache option retains access to the stream until the image is needed, and cleanup is handled by the garbage collector.

Identifier field


Metadata properties set to true


The following code example demonstrates how to set the CacheOption of a BitmapImage by using code.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top