From f7ad5cd9fe965320347521c09900093bc4471ba1 Mon Sep 17 00:00:00 2001 From: "David P.G" Date: Mon, 28 Jul 2025 11:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=AC=E6=8D=A2=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ValueConverts/EnumToStringConverter.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 DMS.WPF/ValueConverts/EnumToStringConverter.cs diff --git a/DMS.WPF/ValueConverts/EnumToStringConverter.cs b/DMS.WPF/ValueConverts/EnumToStringConverter.cs new file mode 100644 index 0000000..3b75ba5 --- /dev/null +++ b/DMS.WPF/ValueConverts/EnumToStringConverter.cs @@ -0,0 +1,22 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace DMS.WPF.ValueConverts +{ + public class EnumToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + return null; + + return value.ToString(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}