lageant.ViewModels.PasswordInputViewModel.PasswordChanged C# (CSharp) 메소드

PasswordChanged() 공개 메소드

User password changed.
public PasswordChanged ( RoutedEventArgs e ) : void
e RoutedEventArgs
리턴 void
        public void PasswordChanged(RoutedEventArgs e)
        {
            var t = e.Source as PasswordBox;

            if (t != null && !string.IsNullOrEmpty(t.Password))
            {
                // Bugfix: cursor position
                if (t.Password.Length == 1)
                {
                    // set the cursor position to 1
                    SetSelection(t, 1, 0);
                }
                UserPassword = t.Password;
            }
            else
            {
                UserPassword = string.Empty;
            }
        }