大量更新
This commit is contained in:
17
Szmedi.RvKits/Converters/NullOrEmptyToBooleanConverter.cs
Normal file
17
Szmedi.RvKits/Converters/NullOrEmptyToBooleanConverter.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user