bitwarden-android/src/App/Utilities/InverseBoolConverter.cs

25 lines
711 B
C#
Raw Normal View History

2019-04-27 04:53:39 +03:00
using System;
using Xamarin.Forms;
namespace Bit.App.Utilities
{
public class InverseBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
if (targetType == typeof(bool))
2019-04-27 04:53:39 +03:00
{
return !((bool?)value).GetValueOrDefault();
}
throw new InvalidOperationException("The target must be a boolean.");
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
}
}