36 lines
1022 B
C#
36 lines
1022 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace MonitoringTechnology.Base
|
|
{
|
|
public class StateBackConvert : IValueConverter
|
|
{
|
|
public static object ConvertObject;
|
|
|
|
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
Brush background = null;
|
|
if ((bool)value == true)
|
|
{
|
|
background = new SolidColorBrush(Color.FromRgb(0, 255, 127));
|
|
}
|
|
else if ((bool)value == false)
|
|
{
|
|
background = new SolidColorBrush(Color.FromRgb(255, 0, 0));
|
|
}
|
|
return background;
|
|
}
|
|
|
|
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|