menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BoolToOpacityConverter - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class BoolToOpacityConverter

    This class converts boolean value to opacity and vice versa.

    Inheritance
    System.Object
    BoolToOpacityConverter
    Implements
    Microsoft.Maui.Controls.IValueConverter
    Namespace: Syncfusion.Maui.Core.Converters
    Assembly: Syncfusion.Maui.Core.dll
    Syntax
    public class BoolToOpacityConverter : Object, IValueConverter

    Constructors

    BoolToOpacityConverter()

    Declaration
    public BoolToOpacityConverter()

    Methods

    Convert(Object, Type, Object, CultureInfo)

    The convert method is used to convert the boolean value to opacity. If the boolean value is true it converts into 1 and if it is false it converts into false.

    Declaration
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    Parameters
    Type Name Description
    System.Object value

    The source data being passed to the target.

    System.Type targetType

    The type of the target property, as a type reference.

    System.Object parameter

    An optional parameter to be used to invert the converter logic.

    System.Globalization.CultureInfo culture

    The culture to use in the converter

    Returns
    Type Description
    System.Object

    The value to be passed to the target property.

    Exceptions
    Type Condition
    System.ArgumentNullException

    ConvertBack(Object, Type, Object, CultureInfo)

    The convert back method is used to convert the opacity value to boolean. If the opacity value is 1 it converts into true and if it is false it converts into 1.

    Declaration
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    Parameters
    Type Name Description
    System.Object value

    The target data being passed to the source.

    System.Type targetType

    The type of the target property, as a type reference.

    System.Object parameter

    An optional parameter to be used to invert the converter logic.

    System.Globalization.CultureInfo culture

    The culture to use in the converter

    Returns
    Type Description
    System.Object

    The value to be passed to the source object.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Implements

    Microsoft.Maui.Controls.IValueConverter
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved