menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ColorBrushConverter - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ColorBrushConverter

    Implements a type converter for converting System.Windows.Media.Color type to and from System.Windows.Media.Brush.

    Inheritance
    System.Object
    ColorBrushConverter
    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.Controls.RichTextBoxAdv
    Assembly: Syncfusion.SfRichTextBoxAdv.WPF.dll
    Syntax
    public class ColorBrushConverter : IValueConverter

    Constructors

    ColorBrushConverter()

    Initializes a new instance of the ColorBrushConverter class.

    Declaration
    public ColorBrushConverter()

    Methods

    Convert(Object, Type, Object, CultureInfo)

    Converts the System.Windows.Media.Color value to the respective System.Windows.Media.Brush value.

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

    The source data being passed to the target.

    System.Type targetType

    The type of the target property.

    System.Object parameter

    An optional parameter to be used in the converter logic.

    System.Globalization.CultureInfo language

    The language of the conversion.

    Returns
    Type Description
    System.Object

    If the value is System.Windows.Media.Color, returns respective System.Windows.Media.SolidColorBrush value. By default empty brush is returned.

    Remarks

    Modifies the source data before passing it to the target for display in the UI.

    ConvertBack(Object, Type, Object, CultureInfo)

    Converts the System.Windows.Media.Brush value to the respective System.Windows.Media.Color value.

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

    The target data being passed to the source.

    System.Type targetType

    The type of the target property, specified by a helper structure that wraps the type name.

    System.Object parameter

    An optional parameter to be used in the converter logic.

    System.Globalization.CultureInfo language

    The language of the conversion.

    Returns
    Type Description
    System.Object

    If the value is System.Windows.Media.SolidColorBrush, returns the respective color. Otherwise returns empty color font.

    Remarks

    Modifies the target data before passing it to the source object. This method is called only in TwoWay bindings.

    Implements

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