using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using System.Windows.Media; namespace PDF_Office.DataConvert { internal class BoolToBrushConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool flag) { if (flag) { //Color color = (Color)App.Current.FindResource("color.sys.text.accent.norm"); return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1770F4")); //return new SolidColorBrush(color); } } return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#616469")); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } } }