private void UserControl_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
 {
     if (!this.IsMouseOver && !contextMenuOpening)
     {
         //if the user clicks somewhere outside of this control while being in edit mode in the data grid, edit mode must be quit
         //ShmVarDataGrid.CancelEdit();
         ShmVarDataGrid.CommitEdit(DataGridEditingUnit.Row, true);
         //we use commit edit, so that the behaviour is the same as clicking somewhere else within the control; this allows committing e.g. an invalid name, but this case must be handled separately anyway (SHM variables must not be used for new connections while the editor is in "invalid" state)
     }
     //MessageBox.Show("UserControl_LostKeyboardFocus");
     contextMenuOpening = false;
 }