using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace formula_manage.ConvertMoels { internal class IonSQLConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string stuff_ion = System.Convert.ToString(value); if (stuff_ion == "0")//类型 { return "分散"; } else { if (stuff_ion == "1") { return "酸性"; } else { if (stuff_ion == "2") { return "活性"; } else { if (stuff_ion == "3") { return "硫化"; } else { if (stuff_ion == "4") { return "阳离子"; } else { if (stuff_ion == "5") { return "酞菁"; } else { if (stuff_ion == "6") { return "直接"; } else { return "未知类型"; } } } } } } } } /// /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } } }