Skip to content

Commit 33aef7e

Browse files
committed
Add convert back implementation for InverseBoolConverter
1 parent cdf3905 commit 33aef7e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Plugins/Flow.Launcher.Plugin.Url/Converters/InverseBoolConverter.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ public class InverseBoolConverter : IValueConverter
99
{
1010
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1111
{
12-
if (targetType != typeof(bool))
13-
throw new InvalidOperationException("The target must be a boolean");
12+
if (value is not bool)
13+
throw new ArgumentException("value should be boolean", nameof(value));
1414

1515
return !(bool)value;
1616
}
1717

1818
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
1919
{
20-
throw new NotSupportedException();
20+
if (value is not bool)
21+
throw new ArgumentException("value should be boolean", nameof(value));
22+
23+
return !(bool)value;
2124
}
2225
}

0 commit comments

Comments
 (0)