| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Data;
- namespace ivf_tl_Manage.Converts
- {
- public class TLStateInfoConvert : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var online = value.ToString();
- if(online == "0")
- {
- if (parameter.ToString() == "1")
- {
- return "pack://application:,,,/ivf_tl_Manage;component/Resources/Images/TLOnline0Icon.png";
- }
- else
- {
- //离线
- return KeyToStringConvert.GetLanguageStringByKey("0009");
- }
- }
- else if(online == "1")
- {
- if (parameter.ToString() == "1")
- {
- return "pack://application:,,,/ivf_tl_Manage;component/Resources/Images/TLOnlineIcon.png";
- }
- else
- {
- //在线
- return KeyToStringConvert.GetLanguageStringByKey("0010");
- }
- }
- else if (online == "2")
- {
- if (parameter.ToString() == "1")
- {
- return "pack://application:,,,/ivf_tl_Manage;component/Resources/Images/TLOnline2Icon.png";
- }
- else
- {
- //解绑
- return KeyToStringConvert.GetLanguageStringByKey("0026");
- }
- }
- else if (online == "3")
- {
- if (parameter.ToString() == "1")
- {
- return null;
- }
- else
- {
- return KeyToStringConvert.GetLanguageStringByKey("0245");
- //return "待初始化";
- }
- }
- else
- {
- if (parameter.ToString() == "1")
- {
- return null;
- }
- else
- {
- return KeyToStringConvert.GetLanguageStringByKey("0246");
- //return "未知";
- }
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|