Esempio n. 1
0
        private void RaiseValidationChangedEvent(string propertyName, bool isValid)
        {
            ValidationChangedHandler   handler = ValidationStateChanged;
            ValidationChangedEventArgs args    = new ValidationChangedEventArgs(propertyName, isValid);

            handler?.Invoke(this, args);
        }
        private void ResourceValidationChanged(object sender, ValidationChangedEventArgs args)
        {
            if (args.IsValid)
            {
                _invalidResourceProperties.Remove(args.PropertyName);
            }
            else
            {
                _invalidResourceProperties.Add(args.PropertyName);
            }

            if (IsUserEditing())
            {
                if (_invalidResourceProperties.Count == 0)
                {
                    _view.LeaveValidationFailedMode();
                }
                else
                {
                    _view.EnterValidationFailedMode();
                }
            }
        }