Silverlight Dataform Validation Doesn't Work

I cannot get the data form, and it manages to catch exceptions when checking.

I have:

<PasswordBox Password="{Binding Password,Mode=TwoWay,NotifyOnValidationError=true,ValidatesOnExceptions=true}" /> 

All required properties are true.

In setting my Password property, I throw a ValidationException after a failed check, but the data form does not break it, it just causes the application to crash, as if it were a normal exception.

Am I doing something wrong? Thanks

+4
source share
2 answers

Does this actually crash the application or just break into the debugger in Visual Studio?

If it just breaks into a debugger, it is by design and nothing will break. You can press F5 to continue, and your check should work properly.

Ultimately, this can become quite annoying. If you want, you can tell the debugger to ignore Silverlight validation exceptions, as described here .

Another slightly different way to avoid this problem is described here .

Hope this helps!

+3
source

Well, apparently, Visual Studio was in some strange state when it caused problems. After reboot, everything works fine. Validation works just as advertised.

+1
source

Source: https://habr.com/ru/post/1306240/


All Articles