public void ActivateTab(string tabName) { if (Tabnames[tabName]) { return; } IsRunning = true; try { switch (tabName) { case "connectionTabItem": { Tabnames[tabName] = CT.ActivateTab(); break; } case "listTabItem": { Tabnames[tabName] = LT.ActivateTab(); break; } case "folderTabItem": { Tabnames[tabName] = FT.ActivateTab(); break; } case "documentTabItem": { Tabnames[tabName] = DT.ActivateTab(Settings.CreateSchema()); break; } } } catch (Exception e) { SIEEMessageBox.Show(e.Message, "Error in " + tabName, MessageBoxImage.Error); DataLoaded = false; SelectedTab = 0; TabNamesReset(); } finally { IsRunning = false; } }