From b34d17f2d1fcd6399bd4bde0fbd34372812e8158 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Mon, 18 May 2026 19:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=20Task.Run=20=E5=8C=85?= =?UTF-8?q?=E8=A3=85=20ExportSectionBoxFromActiveView=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=A4=A7=E6=A8=A1=E5=9E=8B=E5=AF=BC=E5=87=BA=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E5=9B=9E=E5=BD=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 树遍历(GetObjectsAndHiddenItems)在后台线程执行,恢复 4月15日版本的性能 - 导出阶段 NwdExportHelper 内部 Dispatcher.Invoke 回 UI 线程 --- src/UI/WPF/ViewModels/LayerManagementViewModel.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/UI/WPF/ViewModels/LayerManagementViewModel.cs b/src/UI/WPF/ViewModels/LayerManagementViewModel.cs index 2f977da..15aad49 100644 --- a/src/UI/WPF/ViewModels/LayerManagementViewModel.cs +++ b/src/UI/WPF/ViewModels/LayerManagementViewModel.cs @@ -1948,8 +1948,11 @@ namespace NavisworksTransport.UI.WPF.ViewModels // 委托给业务层:验证剖面盒 → 遍历模型树 → 导出 CurrentOperationText = "正在查找剖面盒内的对象..."; - var exporter = new SectionBoxExporter(); - var result = exporter.ExportSectionBoxFromActiveView(document, saveFilePath); + var result = await Task.Run(() => + { + var exporter = new SectionBoxExporter(); + return exporter.ExportSectionBoxFromActiveView(document, saveFilePath); + }); if (result.Success) {