终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CountIsVisiableConvert.cs 1002 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Globalization;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Data;
  10. namespace BPASmartClient.CustomResource.Converters
  11. {
  12. public class CountIsVisiableConvert : IValueConverter
  13. {
  14. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. if (value != null)
  17. {
  18. var count = value?.GetType()?.GetProperty("Count")?.GetValue(value);
  19. if (count != null && count is int tempCount)
  20. {
  21. if (tempCount > 0) return Visibility.Visible;
  22. }
  23. }
  24. return Visibility.Collapsed;
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. }