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