From 27ab485558288c75fc0b9984a19b83cb36896719 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 3 Jun 2026 20:25:15 +0800 Subject: [PATCH] fix: use DialogHelper.ShowAutoClosingMessageBox for import result dialog - 5s auto-close, test automation mode skips dialog - Consistent with existing project patterns --- src/UI/WPF/ViewModels/PathEditingViewModel.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/UI/WPF/ViewModels/PathEditingViewModel.cs b/src/UI/WPF/ViewModels/PathEditingViewModel.cs index 1aff1d8..8cb134f 100644 --- a/src/UI/WPF/ViewModels/PathEditingViewModel.cs +++ b/src/UI/WPF/ViewModels/PathEditingViewModel.cs @@ -5803,26 +5803,24 @@ namespace NavisworksTransport.UI.WPF.ViewModels UpdateMainStatus(statusMsg); var dialogMsg = new StringBuilder(); - dialogMsg.AppendLine($"导入完成"); - dialogMsg.AppendLine(); dialogMsg.AppendLine($"成功导入: {totalImported} 个路径"); if (totalFailed > 0) dialogMsg.AppendLine($"导入失败: {totalFailed} 个路径"); dialogMsg.AppendLine($"来源文件数: {filePaths.Length}"); - System.Windows.MessageBox.Show( + DialogHelper.ShowAutoClosingMessageBox( dialogMsg.ToString(), - "导入结果", - System.Windows.MessageBoxButton.OK, - totalFailed == 0 ? System.Windows.MessageBoxImage.Information : System.Windows.MessageBoxImage.Warning); + "导入完成", + totalFailed == 0 ? System.Windows.MessageBoxImage.Information : System.Windows.MessageBoxImage.Warning, + autoCloseMilliseconds: 5000); } else { UpdateMainStatus($"❌ 导入失败: 所有文件导入失败"); - System.Windows.MessageBox.Show( + DialogHelper.ShowAutoClosingMessageBox( "所有文件导入失败。\n请确认文件格式是否正确。", - "导入结果", - System.Windows.MessageBoxButton.OK, - System.Windows.MessageBoxImage.Error); + "导入失败", + System.Windows.MessageBoxImage.Error, + autoCloseMilliseconds: 5000); } } }