using System; using System.Globalization; using System.Windows.Data; using System.Windows.Media; namespace LocalhostMES.Converters { public class ResultColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string result) { return result == "OK" ? Brushes.Green : Brushes.Red; } return Brushes.Black; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }