Example #1
0
        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);
            }
        }
Example #2
0
 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);
         }
     }
 }