chore: modify open image logic.

This commit is contained in:
NaBian committed 2023-01-17 17:21:18 +08:00
1 parent 456390b775
commit 689d5e7a80
2 files changed
+7 -6

No files matched your search

@@ -166,6 +166,8 @@ public class ImageViewer : Control
private MouseBinding _mouseMoveBinding;
private ImageBrowser _imageBrowser;
#endregion Data
#region ctor
@@ -588,13 +590,11 @@ public class ImageViewer : Control
private void ButtonWindowsOpen_OnClick(object sender, RoutedEventArgs e)
{
try
if (Uri is { } uri)
{
Process.Start(ImgPath);
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
_imageBrowser?.Close();
_imageBrowser = new ImageBrowser(uri);
_imageBrowser.Show();
}
}
@@ -43,6 +43,7 @@ public class ImageBrowser : Window
WindowStartupLocation = WindowStartupLocation.CenterScreen;
WindowStyle = WindowStyle.None;
Topmost = true;
AllowsTransparency = true;
}