public object Convert(object value, Type targetType, object parameter, string language) { if (targetType == typeof(Visibility)) { var c = new VisibilityConverter(); var r = c.Convert(value, targetType, parameter, language); return ((Visibility)r) == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible; } if (targetType == typeof(bool)) { if (value == null) return true; return !((bool) value); } return null; }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType == typeof(Visibility)) { var c = new VisibilityConverter(); var r = c.Convert(value, targetType, parameter, culture); return ((Visibility)r) == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible; } if (targetType == typeof(bool)) { if (value == null) return true; return !((bool) value); } return null; }
public object Convert(object value, Type targetType, object parameter, string language) { if (targetType == typeof(Visibility)) { var c = new VisibilityConverter(); var r = c.Convert(value, targetType, parameter, language); return(((Visibility)r) == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible); } if (targetType == typeof(bool)) { if (value == null) { return(true); } return(!((bool)value)); } return(null); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType == typeof(Visibility)) { var c = new VisibilityConverter(); var r = c.Convert(value, targetType, parameter, culture); return(((Visibility)r) == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible); } if (targetType == typeof(bool)) { if (value == null) { return(true); } return(!((bool)value)); } return(null); }