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) { // 处理 SignalManagementInfo 类型 if (value is SignalManagementInfo smif) { return smif.Status; } if (value is ec_Wire_Group signal) { return signal.Status; } return null; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }