SetErrors() public method

Set the errors at the object level
public SetErrors ( IList errors, HashSet &affectedProperties ) : ErrorsDictionaryUpdateType
errors IList The errors.
affectedProperties HashSet The affected properties.
return ErrorsDictionaryUpdateType
        void ValidateProperty(string propertyName)
        {
            var results = new ValidationResultCollection();

            AttributeBasedValidation(propertyName, results);

            OnValidateProperty(propertyName, results);

            OnErrorsChanged(propertyName, ErrorsDictionary.SetErrors(propertyName, results));
        }
        void ValidateObject()
        {
            var results = new ValidationResultCollection();

            OnValidateObject(results);
            OnErrorsChanged("", ErrorsDictionary.SetErrors(results, out var affectedProperties));

            foreach (var p in affectedProperties)
            {
                OnErrorsChanged(p);
            }
        }