ModuleConverter.cs 924 Bytes
using HHECS.Infrastructure.Enums;
using HHECS.Infrastructure.CommonHelper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using HHECS.Application.Enums;

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();
        }
    }
}