Beispiel #1
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            PasswordRevealMode returnValue = PasswordRevealMode.Hidden;

            if (value is bool)
            {
                if ((bool)value)
                {
                    returnValue = PasswordRevealMode.Visible;
                }
                else
                {
                    returnValue = PasswordRevealMode.Peek;
                }
            }

            return(returnValue);
        }
Beispiel #2
0
 /// <summary>
 /// Sets a value that specifies whether the password is always, never, or
 /// optionally obscured.
 /// </summary>
 /// <param name="passwordBox">The element on which to set the attached property.</param>
 /// <param name="value">The property value to set.</param>
 public static void SetPasswordRevealMode(PasswordBox passwordBox, PasswordRevealMode value)
 {
     passwordBox.SetValue(PasswordRevealModeProperty, value);
 }