using System; using System.Windows.Data; using System.Windows.Media; using PunkHPX8_Core; namespace PunkHPX8_MainPages.Converters { internal class VPWStateConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { VPWCellState currentState = (VPWCellState)Enum.Parse(typeof(VPWCellState), value.ToString()); switch (currentState) { case VPWCellState.Init: return new SolidColorBrush(Colors.Yellow); case VPWCellState.Idle: return new SolidColorBrush(Colors.WhiteSmoke); case VPWCellState.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; } } }