private void MenuItem_ContextConfigureBIPLED_OnClick(object sender, RoutedEventArgs e) { try { var menuItem = (MenuItem)sender; var contextMenu = (ContextMenu)menuItem.Parent; var imageName = contextMenu.Tag.ToString(); var position = GetLedPosition(imageName); var ledConfigsWindow = new LEDConfigsWindow(GlobalHandler.GetAirframe(), "Set configuration for LED : " + position, new SaitekPanelLEDPosition(position), _backlitPanelBIP.GetLedDcsBiosOutputs(position), _backlitPanelBIP); if (ledConfigsWindow.ShowDialog() == true) { //must include position because if user has deleted all entries then there is nothing to go after regarding position _backlitPanelBIP.SetLedDcsBiosOutput(position, ledConfigsWindow.ColorOutputBindings); } ShowGraphicConfiguration(); } catch (Exception ex) { Common.ShowErrorMessageBox(ex); } }