using System; using System.Globalization; using System.Windows.Data; using System.Windows.Media; namespace HC_APTBS.Converters { /// /// Converts a boolean pass/fail value to a background brush for result rows. /// → light green; → light red. /// [ValueConversion(typeof(bool), typeof(SolidColorBrush))] public sealed class BoolToPassFailBrushConverter : IValueConverter { private static readonly SolidColorBrush PassBrush = new(Color.FromRgb(0xC8, 0xFF, 0xC8)); private static readonly SolidColorBrush FailBrush = new(Color.FromRgb(0xFF, 0xC8, 0xC8)); public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is bool b && b ? PassBrush : FailBrush; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); } }