终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

34 行
1002 B

  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. }