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.
When textbox has "bad data" TextBox by hand (tabbing or mouse does not matter) and changing something in the TextBox that is still "bad data" and tabbing away triggers validation routines properly. The problem : event Validation.Error="DatBoxError" is fired twice: first with Action=Added and secondly immediatly after the first call with Action=Removed. So the text in the Tooltip is gone. This is unexpected because the first call has been handled properly and Action=Removed should only be called when validation is OK.
All my validation get failed as our project moves from 3.5 framework to 4.0.
Has anyone come across this issue, or is there something wrong in my code?