Catel.MVVM.ModelErrorInfo.ClearDefaultErrors C# (CSharp) Метод

ClearDefaultErrors() публичный Метод

Updates the default errors. This method is required when errors are initialize via InitializeDefaultErrors. This method checks whether default errors were added for a specific property (or at entity level if propertyName is string.Empty or null). Reason for this is that if the error is known on forehand, the entity implementation will not raise the INotifyDataErrorInfo.ErrorsChanged event. If the default errors are cleared, the validation via INotifyDataErrorInfo.ErrorsChanged will take over from this point.
public ClearDefaultErrors ( string propertyName ) : void
propertyName string Name of the property.
Результат void
        public void ClearDefaultErrors(string propertyName)
        {
            if (string.IsNullOrEmpty(propertyName))
            {
                _businessRuleErrors.Clear();
            }
            else
            {
                lock (_initialErrorFields)
                {
                    if (_initialErrorFields.Contains(propertyName))
                    {
                        lock (_fieldErrors)
                        {
                            if (_fieldErrors.ContainsKey(propertyName))
                            {
                                _fieldErrors[propertyName].Clear();
                            }
                        }

                        _initialErrorFields.Remove(propertyName);
                    }
                }
            }
        }
#endif