diff options
author | sr55 <[email protected]> | 2013-08-27 17:53:01 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-08-27 17:53:01 +0000 |
commit | 530f47597ef140e80f450da085ff058fa74408e3 (patch) | |
tree | 2ef93da3c08ca0780e97c7e477d586e57b3fe6c5 /win/CS/HandBrakeWPF/Converters | |
parent | ec915d89da5cebf5f30b9c8e909a1233d105a14d (diff) |
WinGui: Show a radio button on the filters tab to select between Deinterlace and Decomb mode similar to the Mac/Linux UI's
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5754 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Converters')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/InverseBooleanConverter.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/InverseBooleanConverter.cs b/win/CS/HandBrakeWPF/Converters/InverseBooleanConverter.cs index 8cd29431f..b935953eb 100644 --- a/win/CS/HandBrakeWPF/Converters/InverseBooleanConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/InverseBooleanConverter.cs @@ -16,7 +16,7 @@ namespace HandBrakeWPF.Converters /// <summary>
/// The inverse boolean converter.
/// </summary>
- [ValueConversion(typeof(bool), typeof(bool))]
+ [ValueConversion(typeof(bool?), typeof(bool))]
public class InverseBooleanConverter : IValueConverter
{
/// <summary>
@@ -39,12 +39,14 @@ namespace HandBrakeWPF.Converters /// </returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (targetType != typeof(bool))
+ if (targetType != typeof(bool?) && targetType != typeof(bool))
{
throw new InvalidOperationException("The target must be a boolean");
}
- return !(bool)value;
+ bool result;
+ bool.TryParse(value.ToString(), out result);
+ return !result;
}
/// <summary>
@@ -67,7 +69,7 @@ namespace HandBrakeWPF.Converters /// </returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- throw new NotSupportedException();
+ return null;
}
}
}
\ No newline at end of file |