Force validation on bound controls in WPF

Posted by Valentin Vasilyev on Stack Overflow See other posts from Stack Overflow or by Valentin Vasilyev
Published on 2009-01-27T13:40:33Z Indexed on 2010/04/30 18:17 UTC
Read the original article Hit count: 680

Filed under:
|
|

Hello.

I have a WPF dialog with a couple of textboxes on it. Textboxes are bound to my business object and have WPF validation rules attached.

The problem is that user can perfectly click 'OK' button and close the dialog, without actually entering the data into textboxes. Validation rules never fire, since user didn't even attempt entering the information into textboxes.

Is it possible to force validation checks and determine if some validation rules are broken?

I would be able to do it when user tries to close the dialog and prohibit him from doing it if any validation rules are broken.

Thank you.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about validation