HideNullConverter.cs 597 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Globalization;
  3. using System.Windows;
  4. using System.Windows.Data;
  5. namespace MECF.Framework.UI.Client.Ctrlib.Converter
  6. {
  7. public class HideNullConverter : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  10. {
  11. if (value == null)
  12. {
  13. return Visibility.Collapsed;
  14. }
  15. else
  16. {
  17. return Visibility.Visible;
  18. }
  19. }
  20. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. }
  25. }