Catel.MVVM.ModelErrorInfo.OnModelPropertyChanged C# (CSharp) Method

OnModelPropertyChanged() private method

Called when a property on the model has changed.
private OnModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
sender object The sender.
e System.ComponentModel.PropertyChangedEventArgs The instance containing the event data.
return void
        private void OnModelPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e.PropertyName))
            {
                return;
            }

            var dataWarningInfo = _model as IDataWarningInfo;
            if (dataWarningInfo != null)
            {
                HandleFieldWarnings(e.PropertyName, new[] { dataWarningInfo[e.PropertyName] });
            }

            var dataErrorInfo = _model as IDataErrorInfo;
            if (dataErrorInfo != null)
            {
                HandleFieldErrors(e.PropertyName, new [] { dataErrorInfo[e.PropertyName] });
            }
        }