You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
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 SunlightCentralizedControlManagement_SCCM_.ConvertMoels
|
|
{
|
|
internal class StateToColorConvert : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value == null)
|
|
{
|
|
return null;
|
|
}
|
|
else
|
|
{
|
|
string i = value.ToString();
|
|
|
|
if (i == "201") return "#FF00FF00";
|
|
else if (i == "202") return "Green";
|
|
else if (i == "309") return "#FF000000";
|
|
else if (i == "800") return "Red";
|
|
else return "#FF000000";
|
|
}
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return "#FFF0F0F0";
|
|
}
|
|
}
|
|
}
|
|
|