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]); }
     }
 }