From 43a0207d207390abdeeb3ab9155eebf03edd7b1a Mon Sep 17 00:00:00 2001
From: chr <chr@mailcom>
Date: 星期一, 21 四月 2025 09:28:01 +0800
Subject: [PATCH] 优化;

---
 PdmSwPlugin.PropertySetting/Panel/StandardPartPanel.xaml.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/PdmSwPlugin.PropertySetting/Panel/StandardPartPanel.xaml.cs b/PdmSwPlugin.PropertySetting/Panel/StandardPartPanel.xaml.cs
index 8f5f315..2e6c21a 100644
--- a/PdmSwPlugin.PropertySetting/Panel/StandardPartPanel.xaml.cs
+++ b/PdmSwPlugin.PropertySetting/Panel/StandardPartPanel.xaml.cs
@@ -1,11 +1,13 @@
 锘縰sing System.Collections.Generic;
 using System.ComponentModel;
+using System.IO;
 using System.Runtime.CompilerServices;
 using System.Windows.Controls;
 using PdmSwPlugin.Common.CustomHandler;
 using PdmSwPlugin.Common.Util;
 using PdmSwPlugin.PropertySetting.Interface;
 using PdmSwPlugin.PropertySetting.Panel.Attr;
+using PdmSwPlugin.PropertySetting.Util;
 using SolidWorks.Interop.sldworks;
 using SolidWorks.Interop.swconst;
 
@@ -38,6 +40,11 @@
             }
         }
         #endregion
+
+        static StandardPartPanel()
+        {
+            PropHolder.Register(typeof(StandardPartPanel));
+        }
 
         private Dictionary<string, string> InitData = new Dictionary<string, string>();
 
@@ -92,13 +99,20 @@
         [PropertySettingAttr(Name = NameConstant.weight, NeedSave = false)]
         public string weight
         {
-            get => _weight;
+            get => CustomPropertyUtil.GetMassBySWDM(doc);
             set
             {
                 RaiseAndSetIfChanged(ref _weight, value);
             }
         }
 
+        [PropertySettingAttr(Name = NameConstant.weight, NeedInit = false)]
+        public string weightEval
+        {
+            get => doc == null ? null : $"\"SW-璐ㄩ噺@{Path.GetFileName(doc.GetPathName())}\"";
+            set { }
+        }
+
         private string _designer = "";
         [PropertySettingAttr(Name = NameConstant.designer)]
         public string designer

--
Gitblit v1.9.1