ShowIconConverter.cs 837 B

1234567891011121314151617181920212223242526
  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. public class ShowIconConverter: IMultiValueConverter
  12. {
  13. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. var Visible = ((values[1] == DependencyProperty.UnsetValue ? 0 : (int)values[1]) >=
  16. (values[0] == DependencyProperty.UnsetValue ? 0 : (int)values[0]) ? Visibility.Collapsed : Visibility.Visible );
  17. return Visible;
  18. }
  19. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
  20. {
  21. return null;
  22. }
  23. }
  24. }