public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var selectedPage = value as Model.Page; if (selectedPage == null) { return(null); } else { if (selectedPage.ScreenshotByteArray == null) { return(null); } else { if (selectedPage.CroppedScreenshotByteArray != null) { return(BitmapHelper.BitmapImageFromPath(selectedPage.CroppedScreenshotByteArray)); } else { return(BitmapHelper.BitmapImageFromPath(selectedPage.ScreenshotByteArray)); } } } }
private void InsertScreenshot(object sender, EventArgs args) { var bitmap = BitmapHelper.BitmapImageFromPath(MainVM.CurrentScreenshot); screenshotContainer.Source = bitmap; }