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
You will need to use the page's BaseUri property or the image control's BaseUri property like this:
//using the page's BaseUri property
BitmapImage bitmapImage = new BitmapImage(this.BaseUri,"/Images/800x600/BackgroundTile.bmp");
image.Source = bitmapImage;
or
//using the image control's BaseUri property
image.Source = new BitmapImage(image.BaseUri,"/Images/800x600/BackgroundTile.bmp");
you can see the reason and solution here