# HG changeset patch # User Steven Hollidge # Date 1334839853 -3600 # Node ID f45b8551e79ee418dd093ce58722bf749c91134c # Parent cd9faa9f024bc93c445ef4d6618eb194ecb865a3 Final upload diff -r cd9faa9f024b -r f45b8551e79e SilverlightValidation/SilverlightValidation/UserViewModel.cs --- a/SilverlightValidation/SilverlightValidation/UserViewModel.cs Thu Apr 19 13:39:22 2012 +0100 +++ b/SilverlightValidation/SilverlightValidation/UserViewModel.cs Thu Apr 19 13:50:53 2012 +0100 @@ -45,7 +45,7 @@ #endregion - #region Property + #region Properties private const string UsernameProperty = "Username"; public string Username diff -r cd9faa9f024b -r f45b8551e79e SilverlightValidation/SilverlightValidation/ViewModelBase.cs --- a/SilverlightValidation/SilverlightValidation/ViewModelBase.cs Thu Apr 19 13:39:22 2012 +0100 +++ b/SilverlightValidation/SilverlightValidation/ViewModelBase.cs Thu Apr 19 13:50:53 2012 +0100 @@ -26,7 +26,7 @@ public void SetError(string propertyName, string errorMessage) { if (!_errors.ContainsKey(propertyName)) - _errors.Add(propertyName, new List {errorMessage}); + _errors.Add(propertyName, new List { errorMessage }); RaiseErrorsChanged(propertyName); } @@ -44,13 +44,8 @@ var errors = _errors.Select(error => error.Key).ToList(); foreach (var propertyName in errors) - { - _errors.Remove(propertyName); - RaiseErrorsChanged(propertyName); - } + ClearError(propertyName); } - - #endregion public void RaiseErrorsChanged(string propertyName) { @@ -62,13 +57,15 @@ public IEnumerable GetErrors(string propertyName) { return _errors.ContainsKey(propertyName) - ? _errors[propertyName] - : null; + ? _errors[propertyName] + : null; } public bool HasErrors { get { return _errors.Count > 0; } } + + #endregion } }