예제 #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var para = value as string;

            switch (PasswordStrengthUtils.CalculatePasswordStrength(para))
            {
            case PasswordStrength.VeryWeak: return(20);

            case PasswordStrength.Weak: return(40);

            case PasswordStrength.Average: return(60);

            case PasswordStrength.Strong: return(80);

            case PasswordStrength.VeryStrong: return(100);

            default: return(0);
            }
        }
예제 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var para = value as string;

            switch (PasswordStrengthUtils.CalculatePasswordStrength(para))
            {
            case PasswordStrength.VeryWeak: return(new SolidColorBrush(Colors.Red));

            case PasswordStrength.Weak: return(new SolidColorBrush(Colors.Orange));

            case PasswordStrength.Average: return(new SolidColorBrush(Colors.Yellow));

            case PasswordStrength.Strong: return(new SolidColorBrush(Colors.LightGreen));

            case PasswordStrength.VeryStrong: return(new SolidColorBrush(Colors.Green));

            default: return(new SolidColorBrush(Colors.Gray));
            }
        }