31 lines
803 B
C#
Raw Normal View History

2025-08-15 15:33:20 +08:00
using System;
using System.Globalization;
using System.Windows.Data;
using SWS.Model;
namespace SWS.Commons.Helper.Converter
{
public class StatusToColourConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
2025-09-04 18:28:02 +08:00
// 处理 SignalManagementInfo 类型
if (value is SignalManagementInfo smif)
2025-08-15 15:33:20 +08:00
{
return smif.Status;
}
2025-09-04 18:28:02 +08:00
if (value is ec_Wire_Group signal)
{
return signal.Status;
}
2025-08-15 15:33:20 +08:00
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}