diff --git a/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs b/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs new file mode 100644 index 000000000..419bd070f --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs @@ -0,0 +1,21 @@ +using System; +using System.Windows.Data; + +namespace Flow.Launcher.Plugin.Url.Converters; + +[ValueConversion(typeof(bool), typeof(bool))] +public class InverseBoolConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (targetType != typeof(bool)) + throw new InvalidOperationException("The target must be a boolean"); + + return !(bool)value; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotSupportedException(); + } +}