| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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.Imaging;
- namespace ivf_tl_Manage.Converts
- {
- public class BooleanToBitmapImageConvert : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- try
- {
- var type = parameter.ToString();
- bool s = (bool)value;
- if (s)
- {
- switch (type)
- {
- case "PassWord":
- return new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EditPassWordMouseOverIcon.png", UriKind.Absolute));
- }
- }
- switch (type)
- {
- case "PassWord":
- return new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EditPassWordIcon.png", UriKind.Absolute));
- }
- return null;
- }
- catch (Exception)
- {
- return null;
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|