增加隐藏标题功能

This commit is contained in:
Booker
2024-01-02 19:50:04 +08:00
parent 7d3f1c9af0
commit f1b4698878
3 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
internal class Boolean2VisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool param = false;
if (value != null)
{
param = (bool)value;
}
if (param)
{
return Visibility.Visible;
} else
{
return (Visibility)parameter;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return Visibility.Visible;
}
else
{
return Visibility.Hidden;
}
}
}
}