/// <summary>
/// Gets the warnings for the specific property name.
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <returns><see cref="IEnumerable"/> of warnings.</returns>
IEnumerable INotifyDataWarningInfo.GetWarnings(string propertyName)
{
var elements = new List <string>();
if (HideValidationResults)
{
return(elements);
}
if (string.IsNullOrEmpty(propertyName))
{
lock (_validationContext)
{
foreach (var warning in _validationContext.GetBusinessRuleWarnings())
{
elements.Add(warning.Message);
}
}
}
else
{
lock (_validationContext)
{
foreach (var warning in _validationContext.GetFieldWarnings(propertyName))
{
elements.Add(warning.Message);
}
}
}
return(elements);
}