Auto validation not happening

I'm going through the HOL for DataBinding and validation. I've got the databinding stuff to work (the sample XAML from the Hand-on-lab is from the December CTP, so it required some reworking to be compatible wth the Feb CTP).

However, the Lab documentation says that validation on a text box bound to an integer property should be automatic, and little red boxes should appear around the text box if I enter invalid data.

For some reason this is not happening for me. No errors or anything. The databinding works fine if I enter integers, but then just stops when I enter invalid text. If I delete the text and enter numbers again, databinding works again

Per the lab's instructions, I also added a trigger to the text box style to handle errors, but this also does not get fired:

<Style.Triggers>
<
Trigger Property="Validation.HasError" Value="true">
<
Setter Property="ToolTip"
Value="{Binding RelativeSource Self, Path=(Validation.Errors)].ErrorContent}"/>
</
Trigger>
</
Style.Triggers>

Any ideas what is going on

David



Answer this question

Auto validation not happening