You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
|
|
namespace QYMessageCenter.Client.Converters
|
|
{
|
|
public class AppCodeConverter : IValueConverter
|
|
{
|
|
private IDictionary<string, string> codeDic;
|
|
|
|
public AppCodeConverter()
|
|
{
|
|
codeDic = new Dictionary<string, string>()
|
|
{
|
|
{ "PJZS", "评价助手" },
|
|
{ "BBWYC", "步步为盈C端" },
|
|
{ "BBWYB", "步步为盈B端" },
|
|
{ "QK", "齐库" },
|
|
{ "LK", "良库" },
|
|
{ "SBF", "三板斧" },
|
|
{ "SN", "司南" },
|
|
};
|
|
}
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var appCode = value?.ToString() ?? string.Empty;
|
|
if (codeDic.TryGetValue(appCode, out var appName))
|
|
return appName;
|
|
else return "UnKnow App";
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|