From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;

---
 HMI.DataViewer/DataViewer.xaml.cs |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/HMI.DataViewer/DataViewer.xaml.cs b/HMI.DataViewer/DataViewer.xaml.cs
index 283734b..d704535 100644
--- a/HMI.DataViewer/DataViewer.xaml.cs
+++ b/HMI.DataViewer/DataViewer.xaml.cs
@@ -1,6 +1,7 @@
 锘縰sing HMI.Base;
 using HMI.Core.Util;
 using HMI.DataViewer.Entity;
+using HMI.UI.Converter;
 using HMI.UI.Util;
 using NPOI.SS.Formula.Functions;
 using NPOI.SS.UserModel;
@@ -19,22 +20,7 @@
 
 namespace HMI.DataViewer
 {
-    public class DefaultValueConverter : IValueConverter
-    {
-        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            if (value is DateTime date)
-            {
-                return date.ToString("yyyy-MM-dd HH:mm:ss");
-            }
-            return value.ToString();
-        }
-
-        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
-        {
-            return value;
-        }
-    }
+    
 
     /// <summary>
     /// UserControl1.xaml 鐨勪氦浜掗�昏緫
@@ -65,8 +51,6 @@
         }
 
         private Dictionary<string, DataBase_Setting> Map = new Dictionary<string, DataBase_Setting>();
-
-        private IValueConverter defaultConverter = new DefaultValueConverter();
 
         private void Button_Click(object sender, RoutedEventArgs e)
         {
@@ -285,7 +269,7 @@
                 Header = header,
                 Binding = new System.Windows.Data.Binding(bindingPath)
                 {
-                    Converter = defaultConverter
+                    Converter = DateStrConverter.Instance
                 },
                 Width = new DataGridLength(1, DataGridLengthUnitType.Star)
             };

--
Gitblit v1.9.1