123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Globalization;
- using System.Windows.Data;
- namespace ProximaAnalizer.Converter;
- public class MFCUnitConverter : IValueConverter
- {
- public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is not float unit)
- return value;
- return unit switch
- {
- 0f => "SCCM",
- 1f => "SLM",
- _ => value
- };
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- public class LeakCheckNameConvert : IValueConverter
- {
- public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is not string s)
- return value;
- return s.Replace("LeakCheck", string.Empty);
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
|