diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj index df53b761..f6c8d4ef 100644 --- a/HandyControl/HandyControl.csproj +++ b/HandyControl/HandyControl.csproj @@ -156,6 +156,7 @@ + diff --git a/HandyControl/Themes/Basic/Converters.xaml b/HandyControl/Themes/Basic/Converters.xaml index 8a4d418f..1246361f 100644 --- a/HandyControl/Themes/Basic/Converters.xaml +++ b/HandyControl/Themes/Basic/Converters.xaml @@ -15,5 +15,6 @@ + \ No newline at end of file diff --git a/HandyControl/Tools/Converter/Null2VisibilityConverter.cs b/HandyControl/Tools/Converter/Null2VisibilityConverter.cs new file mode 100644 index 00000000..d1edc482 --- /dev/null +++ b/HandyControl/Tools/Converter/Null2VisibilityConverter.cs @@ -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(); + } + } +}