This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Frontend/Converters/InverseBoolConverter.cs
2019-05-17 18:21:02 -04:00

24 lines
626 B
C#
Executable File

using System;
using System.Globalization;
using Xamarin.Forms;
namespace Aurora.Frontend.Converters
{
public class InverseBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is bool))
{
throw new InvalidOperationException("The target must be a boolean");
}
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}