I\'m trying to programmatically load a BitmapImage in a XAML Metro app. Here\'s my code:
var uri = new Uri(\"/Images/800x600/BackgroundTile.bmp\", UriKind.Re
Judging from the documentation for Windows.Foundation.Uri, it looks like WinRT doesn't support relative URIs. I tried a pack:// URI, but that gave me a UriFormatException, so apparently that's not the way to do it in WinRT either.
I found the answer on this thread: MS invented yet another URI format for WinRT resources. This works:
new Uri("ms-resource://MyAssembly/Images/800x600/BackgroundTile.bmp")
Note that you don't add your actual assembly name -- the MyAssembly
part is literal text.