20220510_191_upperpc/AutomaticApp/Common/StateBackConvert.cs

36 lines
1016 B
C#
Raw Normal View History

2023-07-27 02:57:34 +00:00
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 AutomaticApp.Common
{
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();
}
}
}