at the moment I have a text box with some validation code. In the program they can set the range acceptable by the input box. I'm wondering how would I disable a buttom if the validation failed for the input box. At the moment if my validation fails, a ErrorMessage Prompt appears saying it's out of the acceptable range.
<telerik:RadMaskedCurrencyInput
x:Name="Pv" Grid.Row="0" Grid.Column="1"
IsClearButtonVisible="True"
SelectionOnFocus="SelectAll" HorizontalAlignment="Center"
Width="108"
ErrorMessage="{Binding PvErrorMessage}"
AutoFillNumberGroupSeparators="False"
MaskedInput:MaskedInputExtensions.Minimum="0"
EmptyContent="Enter a Principal">
<telerik:RadMaskedCurrencyInput.Value>
<Binding Path="Pv"
UpdateSourceTrigger="PropertyChanged"
NotifyOnValidationError="True" ValidatesOnExceptions="True">
<Binding.ValidationRules>
<Framework:IntValidationRule
ValidatesOnTargetUpdated="True"
ProductId="{Framework:DataResourceBinding DataResource={StaticResource ProductId}}"
Type="{Framework:DataResourceBinding DataResource={StaticResource Principal}}"
BringForward="{Framework:DataResourceBinding DataResource={StaticResource BringForward}}">
</Framework:IntValidationRule>
</Binding.ValidationRules>
</Binding>
</telerik:RadMaskedCurrencyInput.Value>
</telerik:RadMaskedCurrencyInput>
If the masked input box has an error, I would like to disable my Button
<Button Content="Calculate"
IsEnabled="{Binding CalculatorEnabled}">
Example:
Range $1-$10,000
I input $50,000
Calculator Enabled should be 'False'
How do I update CalculatorEnabled if there's been a validation fail or pass?