mirror of https://github.com/AMT-Cheif/Stylet.git
Add a method to ValidatingModelBase allowing someone to clear all errors
Relates to #17
This commit is contained in:
parent
9e9514a795
commit
f2a61493e3
|
@ -184,6 +184,30 @@ namespace Stylet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear all property errors
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void ClearAllPropertyErrors()
|
||||||
|
{
|
||||||
|
List<string> changedProperties;
|
||||||
|
|
||||||
|
this.propertyErrorsLock.Wait();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
changedProperties = this.propertyErrors.Keys.ToList();
|
||||||
|
this.propertyErrors.Clear();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
this.propertyErrorsLock.Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changedProperties.Count > 0)
|
||||||
|
{
|
||||||
|
this.OnValidationStateChanged(changedProperties);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validate a single property synchronously, by name
|
/// Validate a single property synchronously, by name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue