mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add convert back implementation for InverseBoolConverter
This commit is contained in:
parent
cdf3905a51
commit
33aef7eb54
1 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue