The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

anyoneis (5) [Avatar] Offline
#1
In 18.2.2, the custom validation code does not execute if the [lastname] field is merely tabbed out of, limiting the validity of the code given as a "required field" check - apparently, the setter is never called in this case either.

So, perhaps this should be brought up in the transition paragraph and I shoul read on... smilie

18.4 has that and more problems: If I enter 100 for "level," it get's flagged with an error, since the "salary" has not yet been set to a valid value. If I then enter 60,000, a valid "salary" for that "level," the error is still left showing on "level."

I took care of the problem in this manner:

if (isValid)
{
if (_dataErrors.ContainsKey("Level"))
{
_dataErrors.Remove("Level");
NotifyPropertyChanged("Level");
}
if (_dataErrors.ContainsKey("Salary"))
{
_dataErrors.Remove("Salary");
NotifyPropertyChanged("Salary");
}
}
... else

It seems a NotifyPropertyChanged event is needed to clear the error UI.

Message was edited by:
anyoneis