I am storing images as byte[] arrays because I can't store them as BitmapImage. The ShotItem class will be stored in IsolatedStorage in an observableCollection.
namespace MyProject.Model
{
public class ShotItem : INotifyPropertyChanged, INotifyPropertyChanging
{
private byte[] _shotImageSource;
public byte[] ShotImageSource
{
get
{
return _shotImageSource;
}
set
{
NotifyPropertyChanging("ShotImageSource");
_shotImageSource = value;
NotifyPropertyChanged("ShotImageSource");
}
}
...
}
}
In my xaml file I have the following:
<Image Source="{Binding ShotImageSource}" Width="210" Height="158" Margin="12,0,235,0" VerticalAlignment="Top" />
Unfortunately I can't load the image as a byte straight into the Image container in the xaml. I somehow need to convert the ShotImageSource byte[] to BitmapImage. I am loading quite a few images so would this have to also be done asynchronously.
I tried to use a converter binding, but I wasn't sure on how to get it to work. Any help would be greatly appreciated :).