public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(null); } string pass = (string)value; PasswordStrength strength = PasswordStrengthUtils.CalculatePasswordStrength(pass); return(strength.ToString()); }
private void passwordTxt_TextChanged(object sender, EventArgs e) { var passGen = new PasswordGenerator(); strength = passGen.DetermineStrength(passwordTxt.Text.ToString()); passwordStrengthLbl.Text = "Password Strength: " + strength.ToString(); //dynamically update the strength of the password if (retypedPassTxt.Text != "") { passwordsMatchTxt.Text = passwordTxt.Text == retypedPassTxt.Text ? "Passwords match" : "Passwords do not match"; } }