private void OnPasswordChanged(object sender, RoutedEventArgs e) { BackblazeCredentialDialogViewModel viewModel = this.DataContext as BackblazeCredentialDialogViewModel; if (viewModel != null) { viewModel.ApplicationKey = ((PasswordBox)sender).SecurePassword; } }
private void AddAccountInfo(object obj) { BackblazeCredentialDialogViewModel dialogViewModel = new BackblazeCredentialDialogViewModel(); BackblazeCredentialDialog dialog = new BackblazeCredentialDialog { DataContext = dialogViewModel }; bool?dialogResult = dialog.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { BackblazeB2AdapterConfiguration adapterConfiguration = (BackblazeB2AdapterConfiguration)this.Adapter.Configuration; adapterConfiguration.AccountId = dialogViewModel.AccountId; adapterConfiguration.ApplicationKey = dialogViewModel.ApplicationKey; this.Adapter.InitializeAsync().ConfigureAwait(false); } }