private void statesList_GotFocus(object sender, RoutedEventArgs e) { if (statesList.SelectedItem != null) { OutputGridVM vm = DataContext as OutputGridVM; vm.SelectedIndex = statesList.SelectedIndex; } }
private void registerBox_DropDownClosed(object sender, EventArgs e) { OutputGridVM vm = DataContext as OutputGridVM; try { vm.SetRegister(registerBox.Text); statesList.Focus(); } catch (Exception ex) { MessageBox.Show( "Invalid register:\n" + ex.Message, "Invalid register", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void registerBox_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { OutputGridVM vm = DataContext as OutputGridVM; try { vm.SetRegister(registerBox.Text); statesList.Focus(); } catch (Exception ex) { MessageBox.Show( "Invalid value typed:\n" + ex.Message, "Invalid register", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void SortValue_Click(object sender, RoutedEventArgs e) { OutputGridVM vm = DataContext as OutputGridVM; vm.Sort(SortField.Value); }
private void SortProbability_Click(object sender, RoutedEventArgs e) { OutputGridVM vm = DataContext as OutputGridVM; vm.Sort(SortField.Probability); }