using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TeamAAS_VP.ValueConverter { /// /// 布尔值到文本转换器 /// public class BoolToTextConverter : System.Windows.Data.IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is bool boolValue && parameter is string param) { var options = param.Split('|'); return boolValue ? options[0] : options[1]; } return string.Empty; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }