private void AddConfirmPasswordValidation(IValidateableObject <string> passwordEntered) { ConfirmPassword.ValidationsClear(); ConfirmPassword.ValidationsRules.AddRange(new List <IValidationRule <string> > { new IsNotNullOrEmptyRule <string> { ValidationMessage = "A Password is required." }, new CompareValidationRule <string> { ValidationMessage = "The Passwords are not the same.", CompareToString = passwordEntered.Value } }); }