20 lines
646 B
C#
20 lines
646 B
C#
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace RemoteAccessPlatform.Windows.App.Converters;
|
|
|
|
public sealed class InverseBooleanToVisibilityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
bool visible = value is bool boolValue && !boolValue;
|
|
return visible ? Visibility.Visible : Visibility.Collapsed;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value is Visibility visibility && visibility != Visibility.Visible;
|
|
}
|
|
}
|