WPF Validation with ContentPresenter

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-04-22T23:35:33Z Indexed on 2010/04/24 20:23 UTC
Read the original article Hit count: 475

Hi, I have a WPF user control which needs to validate some fields. It is bound to a class implementing IDataErrorInfo.

When I set the user control as the content of my ContentPresenter in another, already open, window, I can see validation occurring, and error messages being returned, however, I don't get any validation adorner - e.g. the default red outline.

If I enter the field and leave it (triggering re-validation) the validation adorner appears.

Also, if I show the user control in it's own window it shows the validation adorner immediately.

(I'm using Caliburn IResults to do this underneath, e.g. Show.Dialog<VM>(); but I suspect this isn't related)

Can anyone offer any suggestion why the validation adorners aren't appearing immediately. (I had guessed animation on my ContentPresenter ContentChanged, however, I have removed this and still experience the problem.

thanks, Chris

© Stack Overflow or respective owner

Related posts about wpf

Related posts about validation