using System.Globalization; using System.Windows.Data; using System.Windows.Media; namespace ytLive.Helpers; public class DroppedFramesToBrushConverter : IValueConverter { private static readonly SolidColorBrush Attention = new(Color.FromRgb(0xff, 0x8c, 0x3a)); private static readonly SolidColorBrush Clean = new(Colors.White); static DroppedFramesToBrushConverter() { Attention.Freeze(); Clean.Freeze(); } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is int dropped && dropped > 0 ? Attention : Clean; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); }