// This binds all editing mode switch actions for the available modes only private void BindAvailableSwitchActions() { // In case of VisualMode, we only bind the switch action // of the VisualMode to switch back to the previous mode if (mode is VisualMode) { // Bind only the switch action for this mode EditModeInfo info = GetEditModeInfo(mode.GetType()); info.BindSwitchAction(); } else { // Bind all available mode swtich actions foreach (EditModeInfo emi in usedmodes) { emi.BindSwitchAction(); } } }