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