18 lines
559 B
C#
18 lines
559 B
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Szmedi.RvKits.Converters
|
|
{
|
|
public class NullOrEmptyToBooleanConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var str = value as string;
|
|
return !string.IsNullOrEmpty(str); // 非空返回 true
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> throw new NotImplementedException();
|
|
}
|
|
}
|