private void mnuUndock_Click(object sender, RoutedEventArgs e)
        {
            (this.Parent as TabControl).Items.Remove(this);
            UndockedModule rawr = new UndockedModule((UserControl)this.Content,title,copy);
            imdead = true;
            rawr.Width = Width;
            rawr.Height = Height;
            rawr.Show(); 

        }
 private void btnAddElement_Click(object sender, RoutedEventArgs e)
 {
     Cache.elementsSelected.Clear();
     UndockedModule browserTemp = new UndockedModule(new Periodic_Table(TableMode.selection),(string)(Parent as ModuleTabItem).Header +" - Periodic Table Browser - Add Elements",0);
     browserTemp.ShowDialog();
     foreach(Element ele in Cache.elementsSelected)
     {
         elePanes.Add(new ElementPane(TableMode.standard, ele.AtomicNumber - 1)); eleStack.Children.Add(elePanes[elePanes.Count() - 1]);
         elePanes[elePanes.Count - 1].OnChangeValue = CalcMolecule;
         elePanes[elePanes.Count - 1].Loaded += new RoutedEventHandler(RoutedCalcMolecule);
         elePanes[elePanes.Count - 1].Unloaded += new RoutedEventHandler(RoutedCalcMolecule);
     }
     CalcMolecule();
 }
 private void btnAddElement_Click(object sender, RoutedEventArgs e)
 {
     Cache.elementsSelected.Clear();
     Periodic_Table browserTemp = new Periodic_Table(TableMode.selection);//TableMode.selection);
     UndockedModule browserDock = new UndockedModule(browserTemp, (string)(Parent as ModuleTabItem).Header + " - Periodic Table Browser - Add Elements", 0);
     browserDock.ShowDialog();
     foreach(Element ele in Cache.elementsSelected)
     {
         bool alreadyAdded = false;
         foreach (ElementPane elePane in elePanes)
         {
         }
         if (!alreadyAdded) { elePanes.Add(new ElementPane(TableMode.empirical, ele.AtomicNumber - 1)); eleStack.Children.Add(elePanes[elePanes.Count()-1]); }
     }
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.theWindow = ((MyChem_Program.UndockedModule)(target));
     
     #line 5 "..\..\..\UserControl - Miscellaneous\UndockedModule.xaml"
     this.theWindow.Closed += new System.EventHandler(this.theWindow_Closed);
     
     #line default
     #line hidden
     return;
     case 2:
     this.theTabControl = ((MyChem_Program.ModuleTabControl)(target));
     return;
     }
     this._contentLoaded = true;
 }
 private void btnBibliography_Click(object sender, RoutedEventArgs e)
 {
     WebBrowser2 wb = new WebBrowser2(new Uri(System.IO.Path.GetFullPath(@".\MySci User Documentation.htm#_Bibliography")));
     UndockedModule ud = new UndockedModule(wb, "Help", 0);
     ud.Show();
 }