private void hed_main_btn_new_click(object sender, RoutedEventArgs e) { try { Reset(); BitmapImage image = mwh.OpenNewImageDialog(); currentSave = image.UriSource.LocalPath.ToString(); currentBitmap = BitmapImage2Bitmap(image); if (image != null) { ft_tb_currentpath.Text = image.UriSource.ToString(); cnt_image.Height = image.Height; cnt_image.Width = image.Width; cnt_image.Source = image; information.ImageUri = image.UriSource.ToString(); ShowHiddenStartContent(); } else { ShowNotification(NotificationType.Error, "Error", "Couldn't load image. Please try again."); } } catch (NullReferenceException) { ShowNotification(NotificationType.Error, "Image of file not found", "Image referenced in the file wasn't found."); } }