using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using System.Windows.Media; namespace FurnaceUI.Converter { public class PIDShowConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string) { if (!((string)value).Contains(",") || ((string)value).Split(',').Length != 3) { return value; } else { var strList = ((string)value).Split(','); return $"{strList[1]}:{strList[2]}"; } } else return value; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }