Specifies whether the current value of the editor is valid.
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
'Declaration
Public ReadOnly Property IsValueValid As Boolean
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 );
}
'Declaration
Public ReadOnly Property IsValueValid As Boolean
<igEditors:XamTextEditor x:Name="textEditor1" ValueType="{x:Type system:Int32}" >
<igEditors:XamTextEditor.ValueConstraint>
<igEditors:ValueConstraint MinInclusive="10" />
</igEditors:XamTextEditor.ValueConstraint>
</igEditors:XamTextEditor>
'Declaration
Public ReadOnly Property IsValueValid As Boolean
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