Version

XamTextEditor Class

An editor for editing values as strings.
Syntax
'Declaration
 
Public Class XamTextEditor 
   Inherits TextEditorBase
   Implements ISupportsSelectableText 
public class XamTextEditor : TextEditorBase, ISupportsSelectableText  
Remarks

XamTextEditor is a value editor that can be used for editing various data types as strings. You can specify the data type being edited by setting the ValueType property.

The default ValueType for this editor is string. However, you can set the data type to a different type such as System.DateTime in which case the editor will ensure that the value entered by the user is a valid date. It will parse the input into object of type specified by the ValueType property. If parsing fails, the input will be considered invalid and appropriate action will be taken by the editor. The action taken is based on the InvalidValueBehavior property setting. You can use the ValueToTextConverter and ValueToDisplayTextConverter properties to specify custom conversion logic for converting between the text and the value type.

Example
The following code creates a text editor and sets some of the commonly used properties. It sets the ValueType to Double. This will cause the XamTextEditor to automatically parse the entered text into double. If the user enters something that can't be parsed into a double, the editor will take action based on its InvalidValueBehavior setting. The following code also shows you how to set value constraints. It sets the minimum and maximum values allowed in the editor to 0 and 100.

<igEditors:XamTextEditor x:Name="textEditor6"  Value="0" ValueType="{x:Type system:Double}">
    
<igEditors:XamTextEditor.ValueConstraint>
        
<igEditors:ValueConstraint MinInclusive="0"  MaxInclusive="100" Nullable="False" />
    
</igEditors:XamTextEditor.ValueConstraint>
</igEditors:XamTextEditor>
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