Version

IsValueValid Property

Specifies whether the current value of the editor is valid.
Syntax
'Declaration
 
Public ReadOnly Property IsValueValid As Boolean
public bool IsValueValid {get;}
Remarks

This property can be used to find out if the current value of the editor is valid. Value is considered valid if it can be coerced into a ValueType object and it satisfies constraints specified by ValueConstraint object.

When the user input can not be parsed into an object of type ValueType, the Value property will return the last valid value. However the Text property will return the user input.

Example
The following code demonstrates IsValueValid property. XAML code creates a XamTextEditor with its type set to Int32 and ValueConstraint set with MinInclusive of 10. Any value that's not an Int32 or less than 10 will be considered invalid by the editor. IsValueValid property will indicate whether the value is valid or invalid.

Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' The following will print out False. XAML code sets the MinInclusive
    ' to 10 and as a result the value of 9 is invalid.
    Me.textEditor1.Value = 9
    Debug.WriteLine("IsValueValid = " & Me.textEditor1.IsValueValid)

    ' The following will print out True since now after setting the value
    ' to 10, the value is valid.
    Me.textEditor1.Value = 10
    Debug.WriteLine("IsValueValid = " & Me.textEditor1.IsValueValid)
End Sub
public void button1_Click( object sender, RoutedEventArgs e )
{
	// The following will print out False. XAML code sets the MinInclusive
	// to 10 and as a result the value of 9 is invalid.
	this.textEditor1.Value = 9;
	Debug.WriteLine( "IsValueValid = " + this.textEditor1.IsValueValid );

	// The following will print out True since now after setting the value
	// to 10, the value is valid.
	this.textEditor1.Value = 10;
	Debug.WriteLine( "IsValueValid = " + this.textEditor1.IsValueValid );
}
<igEditors:XamTextEditor x:Name="textEditor1" ValueType="{x:Type system:Int32}" >
    
<igEditors:XamTextEditor.ValueConstraint>
        
<igEditors:ValueConstraint MinInclusive="10" />
    
</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