mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-13 07:55:01 +03:00
24 lines
696 B
C#
24 lines
696 B
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace v2rayN.Converters
|
|
{
|
|
[ValueConversion(typeof(bool), typeof(bool))]
|
|
public class InverseBooleanConverter : 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");
|
|
}
|
|
|
|
return !(bool)value;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |