alexa
menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class ColorToBrushConverter

    Represents the class for color to brush converter.

    Inheritance
    System.Object
    ColorToBrushConverter
    Implements
    System.Windows.Data.IValueConverter
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    public class ColorToBrushConverter : IValueConverter

    Constructors

    ColorToBrushConverter()

    Declaration
    public ColorToBrushConverter()

    Methods

    Convert(Object, Type, Object, CultureInfo)

    Converts a System.Windows.Media.Color value to a System.Windows.Media.SolidColorBrush.

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

    The value to convert. Expected to be of type System.Windows.Media.Color.

    System.Type targetType

    The target type of the binding (typically System.Windows.Media.Brush).

    System.Object parameter

    An optional parameter (not used).

    System.Globalization.CultureInfo culture

    The culture information for the conversion.

    Returns
    Type Description
    System.Object

    A System.Windows.Media.SolidColorBrush created from the specified System.Windows.Media.Color.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown if the value is not of type System.Windows.Media.Color.

    ConvertBack(Object, Type, Object, CultureInfo)

    Not implemented. This converter does not support converting back from System.Windows.Media.Brush to System.Windows.Media.Color.

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

    The value produced by the binding target.

    System.Type targetType

    The type to convert to.

    System.Object parameter

    An optional parameter.

    System.Globalization.CultureInfo culture

    The culture information for the conversion.

    Returns
    Type Description
    System.Object

    Always returns null.

    Implements

    System.Windows.Data.IValueConverter
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved