ReverseVisibilityConverter.cs 831 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Globalization;
  3. using System.Windows;
  4. using System.Windows.Data;
  5. namespace Compdfkit_Tools.Common
  6. {
  7. public class ReverseVisibilityConverter : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  10. {
  11. if ((Visibility)value == Visibility.Visible)
  12. {
  13. return Visibility.Collapsed;
  14. }
  15. else
  16. return Visibility.Visible;
  17. }
  18. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. if ((Visibility)value == Visibility.Visible)
  21. {
  22. return Visibility.Collapsed;
  23. }
  24. else
  25. return Visibility.Visible;
  26. }
  27. }
  28. }