private void DatabaseCMLTrainAndPredictWindow_Loaded(object sender, RoutedEventArgs e) { GetDatabases(DatabaseHandler.DatabaseName); GetAnnotators(); GetRoles(); GetSchemes(); parseFiles(); GetSessions(); ApplyButton.Focus(); Update(); }
private void Box_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Enter: Apply(); e.SuppressKeyPress = true; break; case Keys.Escape: Varor.Select(); if (Varor.Items.Count > 0 && Varor.SelectedItems.Count <= 0) { Varor.Items[0].Selected = true; } e.SuppressKeyPress = true; break; case Keys.Up: case Keys.Down: for (int i = 0; i < textBoxes.Length; i++) { if (textBoxes[i].Focused) { if (e.KeyCode == Keys.Up) { if (i != 0) { textBoxes[i - 1].Focus(); } else { ApplyButton.Focus(); } } else { if (i != 2) { textBoxes[i + 1].Focus(); } else { BrowseButton.Focus(); } } break; } } break; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { switchMode(); GetDatabases(DatabaseHandler.DatabaseName); if (mode == Mode.COMPLETE) { AnnoList annoList = AnnoTierStatic.Selected.AnnoList; DatabaseScheme scheme = ((List <DatabaseScheme>)SchemesBox.ItemsSource).Find(s => s.Name == annoList.Scheme.Name); if (scheme != null) { SchemesBox.SelectedItem = scheme; SchemesBox.ScrollIntoView(scheme); } DatabaseRole role = ((List <DatabaseRole>)RolesBox.ItemsSource).Find(r => r.Name == annoList.Meta.Role); if (role != null) { RolesBox.SelectedItem = role; RolesBox.ScrollIntoView(role); } DatabaseAnnotator annotator = ((List <DatabaseAnnotator>)AnnotatorsBox.ItemsSource).Find(a => a.Name == Properties.Settings.Default.MongoDBUser); if (annotator != null) { AnnotatorsBox.SelectedItem = annotator; AnnotatorsBox.ScrollIntoView(annotator); } DatabaseSession session = ((List <DatabaseSession>)SessionsBox.ItemsSource).Find(s => s.Name == DatabaseHandler.SessionName); if (session != null) { SessionsBox.SelectedItem = session; SessionsBox.ScrollIntoView(session); } Update(); } ApplyButton.Focus(); handleSelectionChanged = true; }
private void ViewModel_PreRequestClose(object sender, EventArgs e) { // Get focus from ListViewEditItem, to trigger LostFocus data binding ApplyButton.Focus(); }