You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Aucma.Scada/Aucma.Scada.UI/Converter/ShellInventory/StatusLabelConverter.cs

43 lines
1.0 KiB
C#

using HighWayIot.Common;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Aucma.Scada.UI.Converter.ShellInventory
{
public class StatusLabelConverter : IValueConverter
{
private StringChange stringChange = StringChange.Instance;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(value == null)
{
return false;
}
else
{
int info = (int)value;
if (info == 1)
{
return "green";
}
else
{
return "red";
}
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}