using System; using System.Globalization; using System.Windows.Data; namespace formula_manage.ConvertMoels { internal class UserSQLConvert : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string Capacity = System.Convert.ToString(value); if (Capacity == "0")//类型 { return "停用"; } else { if (Capacity == "1") { return "限制"; } else { if (Capacity == "2") { return "启用"; } else { return "未知类型"; } } } } /// /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } } }