using System; using System.Collections.Generic; using System.Globalization; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; namespace Wpf.Controls { class InverseBooleanConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { bool flag = false; if (value is bool) { flag = (bool)value; } else if (value is bool?) { bool? nullable = (bool?)value; flag = nullable.Value; } return (flag ? Visibility.Collapsed : Visibility.Visible); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return ((value is Visibility) && (((Visibility)value) == Visibility.Collapsed)); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)