using System; using System.Windows.Data; using System.Windows.Media; using PunkHPX8_Core; namespace PunkHPX8_MainPages.Converters { internal class PlatingCellStateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { PlatingCellState currentState = (PlatingCellState)Enum.Parse(typeof(PlatingCellState), value.ToString()); switch (currentState) { case PlatingCellState.Init: return new SolidColorBrush(Colors.Yellow); case PlatingCellState.Idle: return new SolidColorBrush(Colors.WhiteSmoke); case PlatingCellState.Error: return new SolidColorBrush(Colors.Red); default: return new SolidColorBrush(Colors.Lime); } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return null; } } }