ModuleConverter.cs 747 Bytes
using HHECS.Application.Enums;
using System;
using System.Globalization;
using System.Windows.Data;

namespace HHECS.WinCommon.ValueConverter
{
    public class ModuleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string)
            {
                return Enum.Parse<ModuleConst>(value.ToString()).ToDescriptionOrString();
            }
            else
            {
                return "未识别的标志";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}