From 33aef7eb546bda7e7171087b0f342fbb3e8e9668 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 5 Sep 2025 19:02:11 +0800 Subject: [PATCH] Add convert back implementation for InverseBoolConverter --- .../Converters/InverseBoolConverter.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs b/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs index 3f75c07eb..c46d416a8 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs @@ -9,14 +9,17 @@ public class InverseBoolConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (targetType != typeof(bool)) - throw new InvalidOperationException("The target must be a boolean"); + if (value is not bool) + throw new ArgumentException("value should be boolean", nameof(value)); return !(bool)value; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { - throw new NotSupportedException(); + if (value is not bool) + throw new ArgumentException("value should be boolean", nameof(value)); + + return !(bool)value; } }