From f8319438e9f4f5fdc61258cd48aa301467411b2d Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Mon, 1 Jun 2026 10:39:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=20DisplayName=20=E7=9A=84?= =?UTF-8?q?=E5=87=A0=E4=BD=95=E4=BD=93=E8=8A=82=E7=82=B9=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=E3=80=8C=E5=87=A0=E4=BD=95=E5=AF=B9=E8=B1=A1=E3=80=8D?= =?UTF-8?q?=E8=80=8C=E9=9D=9E=E7=A9=BA=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/WPF/Views/AliasTreeControl.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UI/WPF/Views/AliasTreeControl.xaml.cs b/src/UI/WPF/Views/AliasTreeControl.xaml.cs index a3a8cf3..468a27b 100644 --- a/src/UI/WPF/Views/AliasTreeControl.xaml.cs +++ b/src/UI/WPF/Views/AliasTreeControl.xaml.cs @@ -345,7 +345,7 @@ namespace NavisworksTransport.UI.WPF.Views { if (modelItem == null) return null; - string displayName = modelItem.DisplayName ?? "?"; + string displayName = !string.IsNullOrEmpty(modelItem.DisplayName) ? modelItem.DisplayName : "几何对象"; // 父节点 key 可能是完整格式 "IndexPath||DisplayPath",也可能是 ".../name#N" // 只取纯 DisplayPath 部分(去掉 || 前缀和结尾的 #N 后缀) string parentPath = parentDisplayPath; @@ -416,7 +416,7 @@ namespace NavisworksTransport.UI.WPF.Views var nameCount = new Dictionary(); foreach (var childItem in item.Children) { - string name = childItem.DisplayName ?? "?"; + string name = !string.IsNullOrEmpty(childItem.DisplayName) ? childItem.DisplayName : "几何对象"; nameCount.TryGetValue(name, out int count); int siblingIdx = count; nameCount[name] = count + 1;