Exemple #1
0
        /// <summary>
        /// Sets the validation errors for the specified property.
        /// </summary>
        /// <remarks>
        /// If a change is detected then the errors changed event is raised.
        /// </remarks>
        /// <param name="propertyName">The name of the property.</param>
        /// <param name="results">The new validation errors.</param>
        public void SetErrors(string propertyName, IEnumerable <string> results)
        {
            var name = propertyName ?? string.Empty;

            _validationResults.Remove(name);
            _validationResults.AddRange(name, results);

            if (_raiseErrorsChanged != null)
            {
                _raiseErrorsChanged(name);
            }
        }