Exemplo n.º 1
0
 public PasswordDialogClosedEventArgs(PasswordDialog.Result dialogResult)
 {
     DialogResult = dialogResult;
 }
Exemplo n.º 2
0
        private async Task<string> GetPassword()
        {
#if WINDOWS_PHONE_APP
            PasswordDialog dialog = new PasswordDialog();
            var result = await dialog.ShowAsync();
            if(result == ContentDialogResult.Primary)
            {
                return dialog.Password;
            }
            else
            {
                return null;
            }
#elif WINDOWS_UWP
            return null;
#else
            PasswordDialog dialog = new PasswordDialog {IsOpen = true};
            if ((await dialog.WhenClosed()).DialogResult == PasswordDialog.Result.Ok)
            {
                return dialog.Password;
            }
            else
            {
                return null;
            }
#endif
        }