mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-02 03:47:48 +08:00
chore: add Object2BooleanReConverter.
This commit is contained in:
parent
15e3170cf9
commit
f4d47f5af3
@ -17,6 +17,7 @@
|
||||
<converter:TreeViewItemMarginConverter x:Key="TreeViewItemMarginConverter" />
|
||||
<converter:Color2HexStringConverter x:Key="Color2HexStringConverter" />
|
||||
<converter:Object2BooleanConverter x:Key="Object2BooleanConverter" />
|
||||
<converter:Object2BooleanReConverter x:Key="Object2BooleanReConverter" />
|
||||
<converter:Boolean2StringConverter x:Key="Boolean2StringConverter" />
|
||||
<converter:Int2StringConverter x:Key="Int2StringConverter" />
|
||||
<converter:BorderClipConverter x:Key="BorderClipConverter" />
|
||||
|
@ -97,6 +97,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\EventToCommand.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\IEventArgsConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\MouseDragElementBehaviorEx.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Object2BooleanReConverter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\FullScreenHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Window\GlowWindow.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\EnumItem.cs" />
|
||||
|
@ -13,6 +13,7 @@
|
||||
<converter:TreeViewItemMarginConverter x:Key="TreeViewItemMarginConverter"/>
|
||||
<converter:Color2HexStringConverter x:Key="Color2HexStringConverter"/>
|
||||
<converter:Object2BooleanConverter x:Key="Object2BooleanConverter"/>
|
||||
<converter:Object2BooleanReConverter x:Key="Object2BooleanReConverter" />
|
||||
<converter:Boolean2StringConverter x:Key="Boolean2StringConverter"/>
|
||||
<converter:Int2StringConverter x:Key="Int2StringConverter"/>
|
||||
<converter:BorderClipConverter x:Key="BorderClipConverter"/>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<converter:TreeViewItemMarginConverter x:Key="TreeViewItemMarginConverter" />
|
||||
<converter:Color2HexStringConverter x:Key="Color2HexStringConverter" />
|
||||
<converter:Object2BooleanConverter x:Key="Object2BooleanConverter" />
|
||||
<converter:Object2BooleanReConverter x:Key="Object2BooleanReConverter" />
|
||||
<converter:Boolean2StringConverter x:Key="Boolean2StringConverter" />
|
||||
<converter:Int2StringConverter x:Key="Int2StringConverter" />
|
||||
<converter:BorderClipConverter x:Key="BorderClipConverter" />
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user