终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

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