private void BtnAddAccountClick(object sender, RoutedEventArgs e) { if (AccountWindow.Instance != null) { return; } var window = new AccountWindow(); window.ShowDialog(); }
public AccountWindow(Account account = null) { InitializeComponent(); _regionBox.ItemsSource = Enum.GetValues(typeof(Region)).Cast<Region>(); _regionBox.SelectedItem = Settings.Config.SelectedRegion; Instance = this; Loaded += (o, a) => UpdateWindow(); Closed += (o, a) => Instance = null; if (account == null) { return; } _account = account; _usernameBox.Text = _account.Username; _passwordBox.Password = _account.Password; _passwordBoxText.Text = _account.Password; _regionBox.SelectedItem = _account.Region; }
private void CmEditClick(object sender, RoutedEventArgs e) { if (Checker.IsChecking) { this.ShowMessageAsync("Error", "You can't edit accounts while the checker is working."); return; } var account = _accountsGrid.SelectedItem as Account; if (AccountWindow.Instance != null || account == null) { return; } var w = new AccountWindow(account); w.ShowDialog(); }
private void CmViewAccount(object sender, RoutedEventArgs e) { var account = AccountsDataGrid.SelectedItem as Account; if (account == null) { return; } var window = new AccountWindow(account); window.Show(); }
private void ViewAccount() { if (AccountsDataGrid.SelectedItems.Count == 0) { return; } AccountWindow window = new AccountWindow((Account)AccountsDataGrid.SelectedItem); window.Show(); }