Skip to content

Instantly share code, notes, and snippets.

@cmatskas
Created June 15, 2015 21:40
Show Gist options
  • Save cmatskas/7f6efc114f9398293be7 to your computer and use it in GitHub Desktop.
Save cmatskas/7f6efc114f9398293be7 to your computer and use it in GitHub Desktop.
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