123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Windows.Data;
- namespace Venus_Themes.Converters
- {
- public class Bool2Not : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return false;
- if (!(value is bool))
- return false;
- return !(bool)value;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return false;
- if (!(value is bool))
- return false;
- return !(bool)value;
- }
- }
- public class Bool2Easy : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return false;
- if (!(value is bool))
- return false;
- return (bool)value;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return false;
- if (!(value is bool))
- return false;
- return (bool)value;
- }
- }
- }
|