mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
ModVM and ModListVM utilize UIUtils to create images. Null fix
This commit is contained in:
parent
24f94d6bb7
commit
5db61d17ce
@ -18,8 +18,10 @@ namespace Wabbajack.Lib
|
||||
{
|
||||
var img = new BitmapImage();
|
||||
img.BeginInit();
|
||||
img.CacheOption = BitmapCacheOption.OnLoad;
|
||||
img.StreamSource = stream;
|
||||
img.EndInit();
|
||||
img.Freeze();
|
||||
return img;
|
||||
}
|
||||
|
||||
|
@ -68,15 +68,10 @@ namespace Wabbajack
|
||||
.ObserveOn(RxApp.MainThreadScheduler)
|
||||
.Select(memStream =>
|
||||
{
|
||||
if (memStream == null) return default(BitmapImage);
|
||||
try
|
||||
{
|
||||
var image = new BitmapImage();
|
||||
image.BeginInit();
|
||||
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image.StreamSource = memStream;
|
||||
image.EndInit();
|
||||
image.Freeze();
|
||||
return image;
|
||||
return UIUtils.BitmapImageFromStream(memStream);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -69,13 +69,7 @@ namespace Wabbajack
|
||||
if (memStream == null) return default(BitmapImage);
|
||||
try
|
||||
{
|
||||
var image = new BitmapImage();
|
||||
image.BeginInit();
|
||||
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image.StreamSource = memStream;
|
||||
image.EndInit();
|
||||
image.Freeze();
|
||||
return image;
|
||||
return UIUtils.BitmapImageFromStream(memStream);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user