I have a model with property as BitmapImage and I am trying to load and image from root -> Assets -> Icons folder and set it to this property . But always gives me the error "Invalid URI: The format of the URI could not be determined." We originally created this project in WP8.0 and then targeted it to 8.1
BitmapImage bi = new BitmapImage();
bi.UriSource = new Uri(@"../Assets/Icons/noprofilepic.png", UriKind.RelativeOrAbsolute);
bi.CreateOptions = BitmapCreateOptions.BackgroundCreation;
BuddyImage = bi;
Property is defined as :
private BitmapImage _BuddyImage;
public BitmapImage BuddyImage
{
get { return _BuddyImage; }
set { _BuddyImage = value; RaisePropertyChanged("BuddyImage"); }
}
xaml control looks like below
<Image Source="{Binding BuddyImage}" Width="75" Height="75" Stretch="Uniform"/>
use ms-appx:/// for example:
bi.UriSource = new Uri("ms-appx:///Assets/Icons/noprofilepic.png");