private void DisplayOvenOptions_Click(object sender, RoutedEventArgs e)
        {
            string ovenName = DisplayOven.Text;

            if (ovenName.Equals(""))
            {
                MessageBox.Show("No Oven Specified, Please Select the Appropriate Oven.");
            }
            else
            {
                if (DisplayOptionsWrap.Children.Count > 3)
                {
                    DisplayOvenOptionsMaterial.Kind = MaterialDesignThemes.Wpf.PackIconKind.UnfoldMoreVertical;
                    while (DisplayOptionsWrap.Children.Count > 3)
                    {
                        DisplayOptionsWrap.Children.RemoveAt(3);
                    }
                    InitBaseGrid baseGrid = elements[0] as InitBaseGrid;
                    baseGrid.filterGrid(null, -1);
                }
                else
                {
                    DisplayOvenOptionsMaterial.Kind = MaterialDesignThemes.Wpf.PackIconKind.UnfoldLessVertical;
                    WrapPanel addGrid = InitDisplayRecipes();
                    DisplayOptionsWrap.Children.Add(addGrid);
                }
            }
        }
        private void DisplayProgressionChanged(object sender, SelectionChangedEventArgs e)
        {
            InitBaseGrid baseGrid             = elements[0] as InitBaseGrid;
            string       prevProgressionID    = (sender as ComboBox).Text;
            WrapPanel    placeHolderWrapPanel = DisplayOptionsWrap.Children[3] as WrapPanel;
            ComboBox     DisplayRecipe        = placeHolderWrapPanel.Children[1] as ComboBox;
            string       recipeName           = DisplayRecipe.SelectedItem as string;

            if (prevProgressionID != null)
            {
                baseGrid.filterGrid(recipeName, -1);
            }
            string progressionID = (sender as ComboBox).SelectedItem as string;

            if (!progressionID.Equals("All"))
            {
                baseGrid.filterGrid(recipeName, Int32.Parse(progressionID));
            }
        }
        private void DisplayRecipeChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DisplayOptionsWrap.Children.Count > 4)
            {
                DisplayOptionsWrap.Children.RemoveAt(4);
            }
            string    RecipeName = (sender as ComboBox).SelectedItem as string;
            WrapPanel addGrid    = InitDisplayProgression(RecipeName);

            DisplayOptionsWrap.Children.Add(addGrid);
            InitBaseGrid baseGrid = elements[0] as InitBaseGrid;

            baseGrid.filterGrid(RecipeName, -1);
        }
 private void DisplayOvenChanged(object sender, SelectionChangedEventArgs e)
 {
     if ((sender as ComboBox).SelectedIndex != -1)
     {
         string ovenName     = (sender as ComboBox).SelectedItem as string;
         string prevOvenName = DisplayOven.Text;
         if (elements.Count == 1)
         {
             removeInstance(prevOvenName);
         }
         addInstance(ovenName);
         if (DisplayOptionsWrap.Children.Count > 3)
         {
             DisplayOvenOptionsMaterial.Kind = MaterialDesignThemes.Wpf.PackIconKind.UnfoldMoreVertical;
             while (DisplayOptionsWrap.Children.Count > 3)
             {
                 DisplayOptionsWrap.Children.RemoveAt(3);
             }
             InitBaseGrid baseGrid = elements[0] as InitBaseGrid;
             baseGrid.filterGrid(null, -1);
         }
     }
 }