/// <summary>
        /// Load previously stored credentials from the password vault, if any
        /// </summary>
        /// <param name="databaseName"></param>
        /// <returns></returns>
        private async static Task <PasswordParameter> LoadDatabasePasswordAsync(string databaseName)
        {
            var vault = new Windows.Security.Credentials.PasswordVault();
            PasswordCredential cred = vault.Retrieve(databaseName, PASSWORD_VAULT_USER_NAME);

            // Also try to retrieve the KeyFile, if any was saved
            StorageFile keyFile = await PasswordDialogViewModel.GetStoredKeyFileAsync(databaseName);

            return(new PasswordParameter()
            {
                Password = cred.Password,
                KeyFile = keyFile
            });
        }
Пример #2
0
 public PasswordDialogView(PasswordDialogViewModel passwordDialogViewModel)
 {
     InitializeComponent();
     _passwordDialogViewModel = passwordDialogViewModel;
     DataContext = _passwordDialogViewModel;
 }