Commit 22a4fb1a by liulongfei

添加逻辑

parent ea567a1c
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace VIZ.Framework.Core
{
/// <summary>
/// 对象不为空转化器
/// </summary>
public class ObjectNotNull2BoolConverter : IValueConverter
{
/// <summary>
/// 为空时的返回值
/// </summary>
public bool NullResult { get; set; } = false;
/// <summary>
/// 非空时的返回值
/// </summary>
public bool NotNullResult { get; set; } = true;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value == null ? this.NullResult : this.NotNullResult;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
......@@ -103,6 +103,7 @@
<Compile Include="Core\Converter\Bool2SolidColorBrushConverter.cs" />
<Compile Include="Core\Converter\Color2SolidColorBrushConverter.cs" />
<Compile Include="Core\Converter\Enum2EnumDescriptionConverter.cs" />
<Compile Include="Core\Converter\ObjectNotNull2BoolConverter.cs" />
<Compile Include="Core\Converter\String2ImageSourceConverter.cs" />
<Compile Include="Core\Converter\StringAppendConverter.cs" />
<Compile Include="Core\Converter\NumberAddConverter.cs" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment