Is there a way to create a BitmapImage as Sample Data to be used in Blend 2012 Metro Store App (on Windows 8)?
I have a ViewModel as follows:
public ItemDesignDataVM()
{
WebThumbnail = new BitmapImage(new Uri(???));
}
public string ItemId { get { return "123456"; } }
public BitmapImage WebThumbnail { get; private set; }
And would like to bind to it within Xaml like this:
<Page.Resources>
<DesignData:ItemDesignDataVM x:Key="ItemDesignDataVM" />
</Page.Resources>
<TextBox Text="{Binding ItemId}" />
<Image Source="{Binding WebThumbnail}" />
The problem is that no matter what I pass to the BitmapImage constructor it fails to get created. I've tried various different relative paths and an absolute path too.
If I attach to the XDesProc.exe process and debug that code path the BitmapImage.PixelHeight and PixelWidth are 0 which I think means they haven't been loaded.
My binding is correct as I'm seeing the ItemId coming up in the designer.
Any help would be appreciated.