| 1234567891011121314151617181920212223242526272829 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TeamAAS_VP.ValueConverter
- {
- /// <summary>
- /// 布尔值到文本转换器
- /// </summary>
- 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();
- }
- }
- }
|