From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 HMI.UI/Converter/PathImageConverter.cs |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/HMI.UI/Converter/PathImageConverter.cs b/HMI.UI/Converter/PathImageConverter.cs
new file mode 100644
index 0000000..b940837
--- /dev/null
+++ b/HMI.UI/Converter/PathImageConverter.cs
@@ -0,0 +1,29 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media.Imaging;
+using HMI.Core.Util;
+
+namespace HMI.UI.Converter
+{
+    public class PathImageConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null) return null;
+            string imagePath = Path.Combine(PathHelper.IconFolder, value.ToString());
+            if (!File.Exists(imagePath)) return null;
+            return new BitmapImage(new Uri(imagePath));
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return value;
+        }
+    }
+}

--
Gitblit v1.9.1