1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
-
- namespace HistoryView.Converters;
- internal class BoolBurshConverter : IValueConverter
- {
- object? IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is not bool b)
- return null;
- try
- {
- return b switch
- {
- true => Application.Current.Resources["NormalColor"],
- false => Application.Current.Resources["EmergencyColor"]
- };
- }
- catch
- {
- return null;
- }
- }
- object? IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return null;
- }
- }
- internal class BoolBurshConverter2 : IValueConverter
- {
- object? IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is not bool b)
- return Application.Current.Resources["LightThemeColor"];
- try
- {
- return b switch
- {
- true => Application.Current.Resources["LightThemeColor"],
- false => Application.Current.Resources["LightEmergencyColor"]
- };
- }
- catch
- {
- return null;
- }
- }
- object? IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return null;
- }
- }
|