Version

ValueToDisplayTextConverter Property

Specifies the converter used for converting between display text and value.
Syntax
'Declaration
 
Public Property ValueToDisplayTextConverter As IValueConverter
public IValueConverter ValueToDisplayTextConverter {get; set;}
Remarks

The conversions between the 'string' and the ValueType by default are done using built in conversion logic. You can override the default conversion logic by setting the ValueToDisplayTextConverter and ValueToTextConverter. ValueToTextConverter is used when the editor is in edit mode where as ValueToDisplayTextConverter is used when the editor is not in edit mode.

Note: An editor can edit values of types other than 'string'. For example, a XamTextEditor can edit values of types DateTime. You can specify the type of values being edited by the editor using the System.ValueType property.

For most situations the default conversion logic along with the FormatProvider and Format format properties should be sufficient in providing various formatting capabilities.

Although the built-in default conversion logic should be sufficient for most situations, you may want make use of this functionality to provide custom logic for converting value into display text. Examples where this would be needed are if you want to present a value like tomorrow and yesterday's dates as date as words 'Tomorrow' and 'Yesterday' respectively, or apply any kind of custom formatting that could not be specified using FormatProvider and Format property settings.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also