提交 689d5e7a 编写于 作者: N NaBian

chore: modify open image logic.

上级 456390b7
......@@ -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
{
Process.Start(ImgPath);
}
catch (Exception exception)
if (Uri is { } uri)
{
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册