System.Windows.Controls.InvertedBooleanToVisibilityConverter.Convert C# (CSharp) Method

Convert() public method

Convertes the boolean value parameter to a visibility value. True converts to collapsed and false converts to visible.
public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object The boolean value that is to be converted.
targetType Type The type to which the value is to be converted. In this case it is always .
parameter object A parameter for the conversion. Not used in this converter, so it should always be null.
culture System.Globalization.CultureInfo The culture information of the current culture, so that parsing can be adjusted to cultural conventions.
return object
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return DependencyProperty.UnsetValue;
            return (bool)value ? Visibility.Collapsed : Visibility.Visible;
        }
InvertedBooleanToVisibilityConverter