HideNullConverter.cs 648 B

1234567891011121314151617181920212223242526272829
  1. using Aitex.Core.Common;
  2. using System;
  3. using System.Globalization;
  4. using System.Windows;
  5. using System.Windows.Data;
  6. namespace Aitex.Sorter.UI.Converter
  7. {
  8. public class HideNullConverter : IValueConverter
  9. {
  10. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  11. {
  12. if (value == null || (((WaferInfo)value).IsEmpty && !((WaferInfo)value).IsDestination))
  13. {
  14. return Visibility.Collapsed;
  15. }
  16. else
  17. {
  18. return Visibility.Visible;
  19. }
  20. }
  21. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  22. {
  23. throw new NotImplementedException();
  24. }
  25. }
  26. }