This highly practical book contains hundreds of tested recipes for developing interactive Rich Internet Applications.
I'm guessing in that scenario I should be able to simply call Validate() in the View Models constructor. The button that is enabled based on whether Has Errors is false is now disabled at startup, however the error template is not displayed around the textbox that requires a value.
This is one way of doing validation in WPF, but you don't mention the more common approach of IData Error Info Also most people want to know how to do validations from their View Models. There is also a newer idea available in SL which is called INotify Data Error Info, which you can use in WPF if you can be bothered, which pushes validation errors from VM to View.
In fact I just pushed a zip about this to my dropbox account today if you are interested : That method is far better: Validation Also if you want to see how to use IData Error Info with View Models my MVVM framework does that, you can read more here : WPF: If Carlsberg did MVVM Frameworks Part 2 of n Overall I think what you have written has been known for ages, so I am can't give it a rate of more than 3.
When the expander is already expanded it works as expected.
I dunno why, but at least that's my main problem solved.
Sorry I think it is worth nudging this to mention that Sascha is right about view models - I think most people who use WPF in any kind of real-world application use MVVM and therefore have view models of some kind, it would be a useful addition to this article to add some comments on how validation can work for MVVM orientated projects.