12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Windows.Data;
- namespace athosThemes.Converters
- {
- public class StringToString : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if(value == null) return null;
- if (value.ToString().Contains("LL1"))
- {
- return value.ToString().Replace("LL1", "PMA");
- }
- else if (value.ToString().Contains("LL2"))
- {
- return value.ToString().Replace("LL2", "PMB");
- }
- else
- {
- return value;
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (!(value is bool))
- return false;
- return !(bool)value;
- }
- }
-
- }
|