using System; using System.Windows.Data; namespace XHZB.Desktop.Utils { public class ColorTextConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { int v = int.Parse(value.ToString()); if (v == 0) { return "#333333"; } else { return "#ffffff"; } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return null; } } }