A validator that represents the validation state of a model. It's true if all the supplied property validators are true.
Inheritance: ViewModel
        public void IsValidWhenAllValidatorsAreValid()
        {
            var validatableObject = new ValidatableTestObject();
            var validator = PropertyValidator
                .For(validatableObject, o => o.SomeStringProperty)
                .Required("Error occurred!");
            var anotherValidator = PropertyValidator
                .For(validatableObject, o => o.AnotherStringProperty)
                .Required("Error occurred!");
            var modelValidator = new ModelValidator(validator, anotherValidator);

            Assert.IsFalse(modelValidator.IsValid);

            validatableObject.SomeStringProperty = "valid";

            Assert.IsFalse(modelValidator.IsValid);

            validatableObject.AnotherStringProperty = "valid";

            Assert.IsTrue(modelValidator.IsValid);

            validatableObject.AnotherStringProperty = "";

            Assert.IsFalse(modelValidator.IsValid);
        }
        public CredentialsViewModel()
        {
            LoginCommand = new ActionCommand(_ => Result = AuthenticationDialogResult.Ok);
            CancelCommand = new ActionCommand(_ => Result = AuthenticationDialogResult.Cancel);

            LoginValidator = PropertyValidator.For(this, x => x.Login)
                .Required(Resources.LoginRequired);

            PasswordValidator = PropertyValidator.For(this, x => x.Password)
                .Required(Resources.PasswordRequired);

            ModelValidator = new ModelValidator(LoginValidator, PasswordValidator);
            ModelValidator.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(ModelValidator.IsValid))
                {
                    IsValid = ModelValidator.IsValid;
                }
            };
        }