Created
October 9, 2017 01:16
-
-
Save kevinmutlow/16ffd3fe954fd7a4ccbd873de5d5a3c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Text; | |
using Xamarin.Forms; | |
namespace App.Core.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; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment