Files
ThreadPilot/Converters/InverseBooleanConverter.cs
2026-06-24 17:52:45 +02:00

31 lines
799 B
C#

namespace ThreadPilot.Converters
{
using System;
using System.Globalization;
using System.Windows.Data;
public class InverseBooleanConverter : IValueConverter
{
public static readonly InverseBooleanConverter Instance = new();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue)
{
return !boolValue;
}
return true;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue)
{
return !boolValue;
}
return false;
}
}
}