TX Text Control .NET for WPF

Convert 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 an integer or a double precision floating point value to an integer or a double precision floating point value.

Syntax

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

Parameters

ParameterDescription
value

The value produced by the binding source. It must be either a double precision floating point value or an integer.

targetType

The type of the binding target property. It must be either a double precision floating point value or an integer.

parameter

The converter parameter. Is not used by this converter.

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 in a focused Logarithmic Converter workflow.

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