/// <summary> /// Gets the error message, taken from the results of <see cref="Validation"/>, that arose due to the /// value of the input <paramref name="propertyName"/>. /// </summary> /// <param name="propertyName">The name of the property to check for errors.</param> /// <returns>A string representation of the error, or null if there isn't one.</returns> string IDataErrorInfo.this[string propertyName] { get { if (_showValidationErrors && _validation != null) { var result = ValidationResult.Combine(_validation.GetResults(this, propertyName)); return(result.Success ? null : result.GetMessageString("\n")); } return(null); } }