private void menuItemsSelectionChanged(object sender, SelectionChangedEventArgs args) { MenuItemDataModel item = this.lvMenuItems.SelectedItem as MenuItemDataModel; if (item != null) { this.Hide(); switch (item.Code) { case MenuCode.Language: LanguageSelector.ShowBox(this.mainWindow, DI.W.Languages); break; case MenuCode.Dashboards: DashboardConfigSelect.ShowBox(this); break; case MenuCode.Ethernet: //this.runPageManager.Open(typeof(EthernetRun)); break; case MenuCode.Usb: //this.runPageManager.Open(typeof(SerialRun)); break; case MenuCode.Wifi: //this.runPageManager.Open(typeof(WifiRun)); break; case MenuCode.Bluetooth: //this.runPageManager.Open(typeof(BTRun)); RunBT win = new RunBT(); win.ShowDialog(); break; case MenuCode.BLE: //this.runPageManager.Open(typeof(BLE_Full)); break; case MenuCode.CodeSamples: CodeSelectWin.ShowBox(this.mainWindow); break; case MenuCode.Settings: //MainSettings.ShowBox(this.mainWindow); break; default: // Not supported break; } this.lvMenuItems.SelectionChanged -= this.menuItemsSelectionChanged; this.Hide(); this.lvMenuItems.UnselectAll(); this.lvMenuItems.SelectionChanged += this.menuItemsSelectionChanged; } }