I have a button bounded on Validation.HasError property of a textblock. The textblock has a validation rule that checks the value entered by user. The purpose of the binding is that the button should be disabled if the user enters a wrong data.
The problem is that the ValidationRule executes AFTER the binding. So when the user types a wrong value, the binding checks the HasError property of the textblock, which is FALSE, so the button is Enabled. And then the validationrule executes. It results in a reversed situation where the texblock is invalid and the button is enabled.
How could I specify which (binding and validation) executes first ?
Here's the XAML:
<MultiBinding Converter="{StaticResource ButtonVisibilityConverter}" UpdateSourceTrigger="PropertyChanged" Mode="OneWay" >
<Binding ElementName="integerInput" Path="HasValidationError"/>
<Binding ElementName="doubleInput" Path="HasValidationError"/>
</MultiBinding>
</Button.IsEnabled>
I'm sure it isn't the case. The textblock control I'm talking about is a custom spinner (textbox with two +/- buttons). The content of the spinner is bound to a property in the viewmodel. Each time we click on + or - button a command is executed and increments or decrements the value in the textbox.