using System.Globalization; using System.Windows.Data; namespace HKW.WPF.Converters; /// /// 值转换器 /// public abstract class ValueConverterBase : ConverterBase, IValueConverter { /// /// 转换 /// /// 值 /// 目标类型 /// 参数 /// 文化 /// 转换后的值 public abstract object Convert( object value, Type targetType, object parameter, CultureInfo culture ); /// /// 转换回调 /// /// 值 /// 目标类型 /// 参数 /// 文化 /// 转换后的值 public virtual object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture ) { throw new NotSupportedException( "Converter '" + GetType().Name + "' does not support backward conversion." ); } }