I was helping on a Windows Phone application where the requirement was to cache the images the phone downloads on the isolated storage for offline viewing.
I wanted a solution which was simple and as transparent as possible. While researching I found someone wrote a Silverlight converter for loading images from isolated storage. Taking that as a base I created a converted which can
- Load image from web (http + https), and persist it to isolated storage.
- In case of network connectivity issues can load the same image from isolated storage. It does that by mapping the http url to a isolated storage location.
- In case the network is down and the image is neither there in cache, loads a default image, passed as parameter to converter.
To use the converter
- Import the name space.
- Declare the converter as resource.
- Set the Image Source Property to use this converter like this