ConvertBack() public method

Convertes the visibility value parameter to a boolean value. Visible converts to true and collapsed converts to false.
public ConvertBack ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object The visibility 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
Example #1
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is Visibility vis)
     {
         return(vis == Visibility.Visible);
     }
     return(core.ConvertBack(value, targetType, parameter, culture));
 }
 /// <summary>
 /// Converts a <see cref="Visibility"/> enumeration value to a <see cref="bool"/> value.
 /// </summary>
 /// <param name="value">The <see cref="Visibility"/> enumeration value to convert.</param>
 /// <param name="targetType">This parameter is not used.</param>
 /// <param name="parameter">This parameter is not used.</param>
 /// <param name="culture">This parameter is not used.</param>
 /// <returns>Returns false if the value is <see cref="Visibility.Visible"/>, otherwise true.</returns>
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is Visibility)
     {
         return(!((bool)converter.ConvertBack(value, targetType, parameter, culture)));
     }
     else
     {
         throw new InvalidOperationException("The value parameter must be of type System.Windows.Visibility.");
     }
 }
Example #3
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var ret = _converter.ConvertBack(value, targetType, parameter, culture);

            return((bool)ret);
        }
 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     var c = new BooleanToVisibilityConverter();
     return !(bool)c.ConvertBack(value, targetType, parameter, culture);
 }