AntiVisibilityConverter.cs 824 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Data;
  9. namespace ComPDFKit.Controls.Common
  10. {
  11. [ValueConversion(typeof(Visibility), typeof(Visibility))]
  12. internal class AntiVisibilityConverter: IValueConverter
  13. {
  14. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. return (Visibility)value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
  17. }
  18. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. return (Visibility)value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
  21. }
  22. }
  23. }