PasswordDialogWpf.xaml の相互作用ロジック
Inheritance: System.Windows.Window
        /// <summary>
        /// Creates an instance of PasswordDialog and uses it to obtain the user's password.
        /// </summary>
        /// <returns>Returns the user's password as entered, or null if he/she clicked Cancel.</returns>
        public static string GetPassword()
        {
            PasswordDialogWpf dialog = new PasswordDialogWpf();

            dialog.passwordBox.Focus();
            dialog.ShowDialog();

            if (dialog.DialogResult == true)
            {
                return dialog.passwordBox.Password;
            }
            else
            {
                return null;
            } 
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an instance of PasswordDialog and uses it to obtain the user's password.
        /// </summary>
        /// <returns>Returns the user's password as entered, or null if he/she clicked Cancel.</returns>
        public static string GetPassword()
        {
            PasswordDialogWpf dialog = new PasswordDialogWpf();

            dialog.passwordBox.Focus();
            dialog.ShowDialog();

            if (dialog.DialogResult == true)
            {
                return(dialog.passwordBox.Password);
            }
            else
            {
                return(null);
            }
        }