TX Text Control .NET for WPF

ConvertBack Method

Method|Introduced in 16.0
Namespace
TXTextControl.WPF
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.WPF.dll from the private NuGet feed or Text Control Offline Packages

Description

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

Syntax

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture);

Parameters

ParameterDescription
value

The System.Windows.Media.Color value that is produced by the binding target.

targetType

The type to convert to. It must be System.Drawing.Color.

parameter

This parameter is not used and can be set to null.

culture

The culture to use in the converter.

Return Value

The converted value. The method returns DependencyProperty.UnsetValue, if the conversion is not possible.

Examples

The following example uses Convert Back in a focused Color Converter workflow.

var result = colorConverter.ConvertBack("Approved", typeof(object), "Approved", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine($"Convert Back result: {result}");