private void HookErrorsChanged(IPropertyErrors propertyErrors) { if (propertyErrors.Name == _propertyName) { AddHandler(propertyErrors, nameof(IPropertyErrors.ErrorsChanged), HandlePropertyErrorsChanged); } }
private void RemoveError(IPropertyErrors propertyErrors) { if (_propertyErrors.Remove(propertyErrors.Name)) { RaisePropertyErrorsChanged(propertyErrors, PropertyErrorsChangeType.Remove); } }
private void UnHookErrorsChanged(IPropertyErrors propertyErrors) { if (propertyErrors.Name == _propertyName) { RemoveHandler(propertyErrors, nameof(IPropertyErrors.ErrorsChanged), HandlePropertyErrorsChanged); ClearValidationError(); } }
public PropertyErrorsChangedEventArgs(IPropertyErrors propertyErrors, PropertyErrorsChangeType type) { PropertyErrors = propertyErrors; Type = type; }
private void RaisePropertyErrorsChanged(IPropertyErrors propertyErrors, PropertyErrorsChangeType type) { PropertyErrorsChanged?.Invoke(this, new PropertyErrorsChangedEventArgs(propertyErrors, type)); NotifyErrorsChanged(); }
private void AddError(IPropertyErrors propertyErrors) { _propertyErrors.Add(propertyErrors.Name, propertyErrors); RaisePropertyErrorsChanged(propertyErrors, PropertyErrorsChangeType.Add); }