PersistentImageCache (Kawagoe.Storage)

Implements an ImageCache on top of the isolated storage.

PersistentImageCache is optimized in order to minimize its impact on the UI thread. Images are downloaded and persisted to the isolated storage in a background thread. Only the strict minimum is performed on the UI thread, such as setting the source of the BitmapImage instance.

Images downloaded by PersistentImageCache are persisted to the isolated storage for a maximum amount of time specified by the ExpirationDelay property.

In addition, a PersistentImageCache instance manages an in-memory cache of the most recently used images in order to avoid reading from the isolated storage for frequently requested images. The maximum number of images kept in this in-memory cache is specified by the MemoryCacheCapacity property.

Example

<Image Source="{Binding Source}"/>

public class Model
{
    private ImageCache _cache = new PersistentImageCache("cache name");

    // ...

    public ImageSource Source
    {
        get
        {
            return _cache.Get(imageUri);
        }
    }
}

Last edited Sep 5, 2010 at 3:57 PM by andreassaudemont, version 8

Comments

rolandinho Feb 6, 2011 at 4:27 PM 
Is there a way to check the download progress of the image?