using BPA.UIControl.Commons;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace BPA.UIControl.Converters
{
    /// <summary>
    /// 根据 IconType 获取 Icon
    /// </summary>
    public class GetIconConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var iconType = ValidateArgument.NotNullOrEmptyCast<IconType>(value, nameof(value));
            return new Icon { Type = iconType };
        }

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