From f0ca4a57caaeb6d68130e58e574beb300b6394ce Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 24 Feb 2018 20:51:07 +0400 Subject: [PATCH] (GUI): don't clear preview pane before switching to another image. --- GUI/ImagePreview.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GUI/ImagePreview.cs b/GUI/ImagePreview.cs index 6fdecf22..2cb797dd 100644 --- a/GUI/ImagePreview.cs +++ b/GUI/ImagePreview.cs @@ -61,7 +61,7 @@ namespace GARbro.GUI m_active_viewer = value; m_active_viewer.Visibility = Visibility.Visible; bool exists = false; - foreach (var c in PreviewPane.Children.Cast()) + foreach (UIElement c in PreviewPane.Children) { if (c != m_active_viewer) c.Visibility = Visibility.Collapsed; @@ -163,11 +163,9 @@ namespace GARbro.GUI SetStatusText (""); var vm = ViewModel; m_current_preview = new PreviewFile { Path = vm.Path, Name = entry.Name, Entry = entry }; - ImageCanvas.Source = null; - TextView.Clear(); if (!IsPreviewPossible (entry)) { - ActiveViewer = ImageView; + ResetPreviewPane(); return; } if ("image" != entry.Type) @@ -216,6 +214,7 @@ namespace GARbro.GUI } catch (Exception X) { + ResetPreviewPane(); SetStatusText (X.Message); } finally @@ -236,6 +235,7 @@ namespace GARbro.GUI } catch (Exception X) { + Dispatcher.Invoke (ResetPreviewPane); SetStatusText (X.Message); } }