WPF binding not notified of change in error state

WPF binding not notified of change in error state

Old forum URL: forums.lhotka.net/forums/t/5035.aspx


nelis posted on Monday, June 30, 2008

When a property has changed, PropertyHasChanged is called, which in turn checks the validation rules and calls OnPropertyChanged. So any WPF binding to this property is notified. They in turn check the error status when ValidatesOnDataErrors is set for those bindings. Based on the outcome, the ErrorTemplate is either shown or not. So far, so good!

However, when the validation in the previous situation also validates dependent properties and the error state for one of those properties changes, their bindings are not notified because OnPropertyChanged is not called for those properties. That is correct because those properties did indeed not change. But how do I get the bindings notified of the fact that the error state has changed? I noticed that ValidationPanel aka Validator has been removed. That might have been a possible solution for this situation, although I am not sure.

RockfordLhotka replied on Tuesday, July 01, 2008

http://forums.lhotka.net/forums/thread/23845.aspx

The fix is in CSLA .NET 3.5.1 - in a WPF app set the 
   Csla.ApplicationContext.PropertyChangedMode
property once as your app starts up so CSLA knows to do the right thing for WPF data binding.

nelis replied on Thursday, July 03, 2008

Works great, thnx

Copyright (c) Marimer LLC