BitmapSource to point to local file
bitmap, c#, windows-8, xaml
Solution
Are the images already downloaded? If so, are they in the "Local" folder?
If so, you can build a BitmapImage from the path like this
var m_Image = new BitmapImage(new Uri("ms-appdata:///local/" + ImageFileName));
EDIT
If your file is stored in the package as a "never had access and can't download anything" standby, the Uri would be something like
var m_Image = new BitmapImage(new Uri("ms-appx:///Assets/" + FallBackImageFileName));
Problem
What's the best pattern to implement a local cache for a Metro Style App so that the images can be cached in the background while the app is being used on-line and to serve images when the App goes offline? How do we set a BitmapSource to a local file upon discovering the lack of internet access? using new Uri(localpath, UriKind.Absolute) doesn't work.