using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using SWS.CAD.ViewModels; using SWS.Model; namespace SWS.CAD.Helper.Converter { internal class RadGridViewRowToBoolConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SignalManagementInfo smif = value as SignalManagementInfo; if (smif != null) { if (smif.Status.Equals("deleted") || smif.Status.Equals("Confirmed")) { return true; } if (smif.type.Equals("信号")) { switch (parameter.ToString()) { case "关联的电缆信息": case "关联的通道信息": return true; } } else { switch (parameter.ToString()) { case "组别": case "编码": case "信号类型": case "Min": case "Max": case "单位": case "CODE": case "设备名": case "关联的电缆信息": case "关联的通道信息": return true; } } } return false; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }