VisibilityToReverse.cs 865 B

123456789101112131415161718192021222324252627282930313233
  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 Venus_Themes.Converters
  9. {
  10. public class VisibilityToReverse : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (value == null) return Visibility.Collapsed;
  15. if ((Visibility)value == Visibility.Visible)
  16. {
  17. return Visibility.Collapsed;
  18. }
  19. else
  20. {
  21. return Visibility.Visible;
  22. }
  23. }
  24. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  25. {
  26. return null;
  27. }
  28. }
  29. }