menu

MAUI

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

    Show / Hide Table of Contents

    Class BrushToColorConverter

    This class converts brush type to color type and vice versa.

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

    Constructors

    BrushToColorConverter()

    Declaration
    public BrushToColorConverter()

    Methods

    Convert(Object, Type, Object, CultureInfo)

    Converts brush value to an color type.

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

    The value must be the type of SolidColorBrush

    System.Type targetType

    The type of the target property

    System.Object parameter

    An additional parameter for the converter to handle, not used

    System.Globalization.CultureInfo culture

    The culture to use in the converter, not used

    Returns
    Type Description
    System.Object

    Returns the color value of the brush

    Exceptions
    Type Condition
    System.ArgumentException

    Exception is thrown when the value type is null or not a type of SolidColorBrush

    ConvertBack(Object, Type, Object, CultureInfo)

    Converts back the color to brush type.

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

    The value must be the type of color

    System.Type targetType

    The type of the target property

    System.Object parameter

    An additional parameter for the converter to handle, not used

    System.Globalization.CultureInfo culture

    The culture to use in the converter, not used

    Returns
    Type Description
    System.Object

    Returns the brush value of the color

    Exceptions
    Type Condition
    System.ArgumentException

    Exception is thrown when the value type is null or not a type of Color

    Implements

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