views:

104

answers:

2

I've just started to follow the EntLib hands on labs for the validation integration with WPF.

http://www.microsoft.com/downloads/details.aspx?FamilyID=4f8cd377-5522-4f45-a024-44a6ca5111ec&displaylang=en

What I have found is that my textbox's databinding is firing fine when my validators pass. I have a string property with the following validators;

  • Required validator
  • StringLengthValidator (with a max length set)

Like I say, the binding fires fine when the validators pass. However, if I then delete the textbox text, for example, (making my textbox again invalid) the binding is not fired and my view model object remains as it was the last time it was valid.

Why is this? Can anyone please show me where I'm going wrong? I would be very grateful.

Thanks.

A: 

Anyone had any experience of this?

James Smith
A: 

I have just started reading about the WPF features of VAB. I came across this information http://msdn.microsoft.com/en-us/library/ff664451(PandP.50).aspx which possibly goes towards answering you question.

The paragraph starts - "If the value of the validated control that carries the Required validation attribute is empty to begin with"

Allan