ValidatingBindable - nkristek/Smaragd GitHub Wiki
The ValidatingBindable abstract class provides an implementation of the INotifyDataErrorInfo interface and inherits from Bindable.
To set the errors of a property use the SetErrors method. It's important to set the errors every time validation is performed. When no errors exist, set an empty enumeration or null.
private object _myProperty;
public object MyProperty
{
get => _myProperty;
set
{
if (SetProperty(ref _myProperty, value)
{
// perform validation like
var errors = new List<string>();
if (MyProperty == null)
errors.Add("MyProperty should not be null.");
SetErrors(errors);
}
}
}