You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 rivejä
702 B

  1. using System;
  2. using System.Globalization;
  3. using System.Windows;
  4. using System.Windows.Data;
  5. namespace BPA.UIControl.Converters
  6. {
  7. /// <summary>
  8. /// 是否为 null 或空字符串
  9. /// </summary>
  10. public class IsNullOrEmptyConverter : IValueConverter
  11. {
  12. /// <inheritdoc/>
  13. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. return value == null || string.IsNullOrEmpty(value.ToString());
  16. }
  17. /// <inheritdoc/>
  18. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. return DependencyProperty.UnsetValue;
  21. }
  22. }
  23. }