I'm seeing some weird behavior with the Validation.Error attached event. I have a textbox bound to an object that implements the IDataErrorInfo interface. The textbox subscribes to the Validation.Error event. What is weird is that when you
put the text box into an invalid state, the Validation.Error event gets triggered twice. Under .NET 3.5, the first time ValidationErrorEventArgs.Action == Removed. The second time ValidationErrorEventArgs.Action == Added. Under .NET 4, it's reversed. The first
time ValidationErrorEventArgs.Action == Added. The second time ValidationErrorEventArgs.Action == Removed.
Why would it be called twice and why would it work differently under .NET 3.5 and .NET 4?
I'm trying to implement a validation summary control similar to the one from ASP.NET. There is a solution here:
but it doesn't work under .NET 4 because in order for it work work, when you put a control into an invalid state, the last call to the Validation.Error event has to be with ValidationErrorEventArgs.Action == Added. Here is my code:
View Complete Post