InverseBoolToVisibilityConverter .cs 803 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Data;
  8. namespace MeterVision.Converter
  9. {
  10. public class InverseBoolToVisibilityConverter : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (value is bool boolValue)
  15. {
  16. return boolValue ? Visibility.Hidden : Visibility.Visible;
  17. }
  18. return Visibility.Hidden;
  19. }
  20. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. }
  25. }