From 7deb5b1aae7b1239a7db424c1adcb4ae16622016 Mon Sep 17 00:00:00 2001 From: doudou0720 <98651603+doudou0720@users.noreply.github.com> Date: Mon, 23 Feb 2026 23:08:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BB=B6=E8=BF=9F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=BB=A5=E9=81=BF=E5=85=8D=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com> --- .../MainWindow_cs/MW_Save&OpenStrokes.cs | 66 +++++++++++++++++-- Ink Canvas/MainWindow_cs/MW_Screenshot.cs | 8 ++- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs b/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs index 71f2a250..32e55e1a 100644 --- a/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs +++ b/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs @@ -218,7 +218,16 @@ namespace Ink_Canvas // 单页面XML保存 string xmlPath = Path.ChangeExtension(savePathWithName, ".xml"); SaveStrokesAsXML(inkCanvas.Strokes, xmlPath); - if (newNotice) ShowNotification("墨迹成功保存为XML格式至 " + xmlPath); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification("墨迹成功保存为XML格式至 " + xmlPath); + }); + }); + } } } else @@ -229,7 +238,16 @@ namespace Ink_Canvas // 保存为XML格式 string xmlPath = Path.ChangeExtension(savePathWithName, ".xml"); SaveStrokesAsXML(inkCanvas.Strokes, xmlPath); - if (newNotice) ShowNotification("墨迹成功保存为XML格式至 " + xmlPath); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification("墨迹成功保存为XML格式至 " + xmlPath); + }); + }); + } } else { @@ -237,7 +255,16 @@ namespace Ink_Canvas var fs = new FileStream(savePathWithName, FileMode.Create); inkCanvas.Strokes.Save(fs); fs.Close(); - if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification("墨迹成功保存至 " + savePathWithName); + }); + }); + } } _ = Task.Run(async () => { @@ -456,7 +483,16 @@ namespace Ink_Canvas } }); - if (newNotice) ShowNotification($"多页面XML墨迹成功保存至压缩包 {zipFileName}"); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification($"多页面XML墨迹成功保存至压缩包 {zipFileName}"); + }); + }); + } } finally { @@ -564,7 +600,16 @@ namespace Ink_Canvas } }); - if (newNotice) ShowNotification($"多页面墨迹成功保存至压缩包 {zipFileName}"); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification($"多页面墨迹成功保存至压缩包 {zipFileName}"); + }); + }); + } } finally { @@ -667,7 +712,16 @@ namespace Ink_Canvas } // 显示提示 - if (newNotice) ShowNotification("墨迹成功全页面保存至 " + Path.ChangeExtension(savePathWithName, "png")); + if (newNotice) + { + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification("墨迹成功全页面保存至 " + Path.ChangeExtension(savePathWithName, "png")); + }); + }); + } } /// diff --git a/Ink Canvas/MainWindow_cs/MW_Screenshot.cs b/Ink Canvas/MainWindow_cs/MW_Screenshot.cs index b944299b..9a548756 100644 --- a/Ink Canvas/MainWindow_cs/MW_Screenshot.cs +++ b/Ink Canvas/MainWindow_cs/MW_Screenshot.cs @@ -356,7 +356,13 @@ namespace Ink_Canvas if (!isHideNotification) { - ShowNotification($"截图成功保存至 {savePath}"); + Task.Delay(100).ContinueWith(t => + { + Dispatcher.Invoke(() => + { + ShowNotification($"截图成功保存至 {savePath}"); + }); + }); } _ = Task.Run(async () => {