public static void SetCursorOnEnd(this PasswordBox passwordBox) { int start = passwordBox.Password.Length; int length = 0; passwordBox.SetSelection(start, length); }