Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adamsteinert/5698928 to your computer and use it in GitHub Desktop.
Save adamsteinert/5698928 to your computer and use it in GitHub Desktop.
public class BooleanToVisibileHiddenConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var boolean = false;
if (value is bool) boolean = (bool)value;
return boolean ? Visibility.Visible : Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is Visibility && (Visibility)value == Visibility.Visible;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment