Created
June 15, 2015 21:40
-
-
Save cmatskas/7f6efc114f9398293be7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class BackgroundValueConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, string language) | |
{ | |
var passwordStrength = int.Parse(value.ToString()); | |
if (passwordStrength > 33 && passwordStrength <= 66) | |
{ | |
return new SolidColorBrush(Colors.Orange); | |
} | |
if (passwordStrength > 66) | |
{ | |
return new SolidColorBrush(Colors.Green); | |
} | |
return new SolidColorBrush(Colors.Red); | |
} | |
public object ConvertBack(object value, Type targetType, | |
object parameter, string language) | |
{ | |
throw new NotImplementedException(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment