Christian
Well I have tried that too and it ended in Invalid cross thread exception error...
the code changes:
public class ThumbnailsViewModel : INotifyPropertyChanged { BitmapImage bmImage1;
................
............................
}
Code:
private BitmapImage base64StringToImage(string base64String)
{
bmImage1 = new BitmapImage();
Byte[] imageBytes = Convert.FromBase64String(base64String);
using (MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
{
ms.Write(imageBytes, 0, imageBytes.Length);
using (AutoResetEvent are = new AutoResetEvent(false))
{
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
{
bmImage1.SetSource(ms);
are.Set();
});
are.WaitOne();
//ms.Close();
//ms.Dispose();
}
}
//Thread.Sleep(1000);
//BitMapImageCheck(bmImage1);
return bmImage1;
}
bmImage1 = new BitmapImage(); ---> this is where the error is hit, what to do?