public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string) { int str = (int)PasswordStrengthUtils.CalculatePasswordStrength(value as string); switch (str) { case 0: return(Brushes.Red); case 1: return(Brushes.Red); case 2: return(Brushes.Orange); case 3: return(Brushes.Yellow); case 4: return(Brushes.Lime); case 5: return(Brushes.Green); default: return(null); } } return(null); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string) { int str = (int)PasswordStrengthUtils.CalculatePasswordStrength(value as string); return(Enum.GetName(typeof(PasswordStrength), str)); } return(null); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string) { int str = (int)PasswordStrengthUtils.CalculatePasswordStrength(value as string); return($"{5-str}*"); } return(null); }