using HandyControl.Tools.Extension; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace XGLFinishPro.Tools { public class ShiftConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value.ToString().IsNullOrEmpty()) { return "未发起检测"; } else if (value.Equals("0")) { return "待检测"; } else if (value.Equals("1")) { return "监测中"; } else if (value.Equals("2")) { return "检测完成"; } else if(value.Equals("5")) { return "白班"; } else { return "夜班"; } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { // 如果需要双向绑定,也需要实现 ConvertBack 方法 throw new NotImplementedException(); } } }