private void Open_Shell(object sender, RoutedEventArgs e) { RocketNode selectedObject = (RocketNode)lNodes.SelectedItem; if (selectedObject != null) { ShellUI shell = ShellUI.StartShell(selectedObject); shell.Show(); } }
public static ShellUI StartShell(RocketNode node) { if (openedUIs.ContainsKey(node)) { return(openedUIs[node]); } ShellUI ui = new ShellUI(node); ui.Closed += (s, e) => openedUIs.Remove(node); openedUIs.Add(node, ui); return(ui); }