chore: add Object2BooleanReConverter.

This commit is contained in:
NaBian committed 2022-09-03 20:22:19 +08:00
1 parent 15e3170cf9
commit f4d47f5af3
6 files changed
+20 -1

No files matched your search

@@ -6,7 +6,7 @@ namespace HandyControl.Tools.Converter;
public class Object2BooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => !(value is null);
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is not null;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
@@ -0,0 +1,15 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace HandyControl.Tools.Converter;
public class Object2BooleanReConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is null;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}