public Notification ValidateModel(T instance)
        {
            Notification result = new Notification();

            if (instance != null)
            {
                var validationResult = Validate(instance);

                foreach (var error in validationResult.Errors)
                {
                    NotificationItem errorItem = new NotificationItem(error.ErrorMessage, NotificationSeverity.Error)
                    {
                        Reference = error.PropertyName
                    };
                    result.Add(errorItem);
                }
            }

            return(result);
        }
 public void Add(NotificationItem notificationItem)
 {
     Items.Add(notificationItem);
 }
        public void Add(string message, NotificationSeverity severity = NotificationSeverity.Error)
        {
            var item = new NotificationItem(message, severity);

            Items.Add(item);
        }