public MovableUserControl addWindowToGrid(UserControl userControl, String title, bool noSavingFlag) { MovableUserControl currentInnerWindow = new MovableUserControl(RootGrid); currentInnerWindow.setTitle(title); currentInnerWindow.setGridContent(userControl); currentInnerWindow.Visibility = Visibility.Hidden; if (noSavingFlag) { currentInnerWindow.disableSaving(); } RootGrid.Children.Add(currentInnerWindow); return(currentInnerWindow); }
public MacroManager() { macros = new ConcurrentDictionary <String, CycleMacro>(); macroGallery = new MacroGallery(); macroGallery.initialize(); macroAddControl = new MacroAddControl(); ownParentWindow = App.overlay.addWindowToGrid(macroGallery, "Macros", false); macroCreateWindow = App.overlay.addWindowToGrid(macroAddControl, "Create new macro", false); App.overlay.addMenuItemToMenu("pack://application:,,,/Resources/macroMenuIcon.png", "Macros").Click += macroMenu_Click; PersistenceContainer[] savedMacros = PersistenceUnitThread.persistenceUnit.loadContainersByType(typeof(CycleMacro).Name); foreach (PersistenceContainer currentPersistenceContainer in savedMacros) { CycleMacro newMacro = new CycleMacro(); newMacro.updateCycleMacroByPersistenceContainer(currentPersistenceContainer); macros.GetOrAdd(newMacro.name, newMacro); } }
public BdmtSettings() { settingsWindow = new SettingsWindow(); ownParentWindow = App.overlay.addWindowToGrid(settingsWindow, "Settings", true); }