增加了Null2VisibilityConverter转换器

value是Null的时候隐藏,不为Null时显示
This commit is contained in:
眾尋 committed 2019-04-17 00:04:43 +08:00
1 parent 26882ec086
commit 2f5c21fc62
3 files changed
+22

No files matched your search

@@ -0,0 +1,20 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace HandyControl.Tools.Converter
{
public class Null2VisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value == null ? Visibility.Collapsed : Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}