void AddCombo(object sender, RoutedEventArgs e)
        {
            BriarheartBurger      entree = new BriarheartBurger();
            DragonbornWaffleFries side   = new DragonbornWaffleFries();
            ArentinoAppleJuice    drink  = new ArentinoAppleJuice();
            Combo combo  = new Combo(entree, side, drink);
            var   screen = new ComboCustom();

            menuBorder.Child   = screen;
            screen.DataContext = combo;
            if (DataContext is Order order)
            {
                order.Add(combo);
            }
        }
        /// <summary>
        /// sets new BriarheartBurger object as DataContext of the customization screen
        /// binds form controls to object properties
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void CustomizeItem(object sender, RoutedEventArgs e)
        {
            BriarheartBurger b  = new BriarheartBurger();
            var customizeScreen = new MenuItemCustomization();

            //set DataContext
            customizeScreen.DataContext = b;
            //databinding
            customizeScreen.bunCheckBox.IsChecked     = b.Bun;
            customizeScreen.ketchupCheckBox.IsChecked = b.Ketchup;
            customizeScreen.mustardCheckBox.IsChecked = b.Mustard;
            customizeScreen.pickleCheckBox.IsChecked  = b.Pickle;
            customizeScreen.cheeseCheckBox.IsChecked  = b.Cheese;
            //switch screen
            selectionBorder.Child = customizeScreen;
        }
Exemple #3
0
        /// <summary>
        /// Event handler that Goes to the briarheart burger special instructions
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void GoToBriarheartInstructions(object sender, RoutedEventArgs e)
        {
            BriarheartBurger bb = new BriarheartBurger();

            mainGrid.Children.RemoveAt(1);
            mainGrid.Children.Add(briarheartBurger);
            briarheartBurger.DataContext = bb;
            if (entreeMenu.FromCombo)
            {
                combo.Entree = bb;
            }
            else
            {
                ((Order)this.DataContext).Add(bb);
            }
        }
 /// <summary>
 /// Click event for briarheartBurgerButton. Opens briarheart burger customization screen when button is clicked.
 /// </summary>
 /// <param name="sender">Reference to the object that raised the event.</param>
 /// <param name="e">Contains the event data.</param>
 void OpenBriarheartBurgerCustomization(object sender, RoutedEventArgs e)
 {
     if (((Combo)this.DataContext).Entree is BriarheartBurger oldbb)
     {
         var bbCustomization = new BriarheartBurgerCustomization(currentOrder, true, (Combo)this.DataContext);
         bbCustomization.DataContext = oldbb;
         fullComponentBorder.Child   = bbCustomization;
     }
     else
     {
         BriarheartBurger bb = new BriarheartBurger();
         var bbCustomization = new BriarheartBurgerCustomization(currentOrder, true, (Combo)this.DataContext);
         ((Combo)this.DataContext).Entree = bb;
         bbCustomization.DataContext      = bb;
         fullComponentBorder.Child        = bbCustomization;
     }
 }
 void AddBriarheartBurger(object sender, RoutedEventArgs e)
 {
     if (IsCombo)
     {
         c.Entree = new BriarheartBurger();
         CustomizeComboMeal custom         = new CustomizeComboMeal(c);
         OrderComponent     orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
     if (DataContext is Order order)
     {
         BriarheartBurger b = new BriarheartBurger();
         order.Add(b);
         CustomizeBriarheartBurger custom         = new CustomizeBriarheartBurger(b, false);
         OrderComponent            orderComponent = this.FindAncestor <OrderComponent>();
         orderComponent.Swap(custom);
     }
 }
Exemple #6
0
        // public MainWindow mainwindow = new MainWindow();
        /// <summary>
        /// navigates to the briar burger cutomizations
        /// </summary>
        /// <param name="sender">button being sent</param>
        /// <param name="e">button pressed</param>
        private void BriarBurger_Click(object sender, RoutedEventArgs e)
        {
            var bb = new BriarheartBurger();


            Briarhear_Burgers bBurger = new Briarhear_Burgers(ancestor);


            // this.NavigationService.Navigate(bBurger);
            bBurger.DataContext = bb;
            CurrentSelection?.Invoke(this, new CustomizationSelector()
            {
                orderItem = bb
            });
            //window.finallist.Add(bb);
            window.newOrder.Add(bb);
            ancestor.SwitchScreen(Screen.custBriarheart, bb);
        }
 private void EntreeButtonChangeHandler(object sender, EventArgs e)
 {
     if (sender is ListBox lb)
     {
         if (this.DataContext is Combo combo)
         {
             if (lb.SelectedIndex == 0)
             {
                 BriarheartBurger bb = new BriarheartBurger();
                 combo.Entree = bb;
             }
             if (lb.SelectedIndex == 1)
             {
                 DoubleDraugr dd = new DoubleDraugr();
                 combo.Entree = dd;
             }
             if (lb.SelectedIndex == 2)
             {
                 ThalmorTriple tt = new ThalmorTriple();
                 combo.Entree = tt;
             }
             if (lb.SelectedIndex == 3)
             {
                 GardenOrcOmelette goo = new GardenOrcOmelette();
                 combo.Entree = goo;
             }
             if (lb.SelectedIndex == 4)
             {
                 PhillyPoacher pp = new PhillyPoacher();
                 combo.Entree = pp;
             }
             if (lb.SelectedIndex == 5)
             {
                 SmokehouseSkeleton ss = new SmokehouseSkeleton();
                 combo.Entree = ss;
             }
             if (lb.SelectedIndex == 6)
             {
                 ThugsTBone ttb = new ThugsTBone();
                 combo.Entree = ttb;
             }
         }
     }
 }
Exemple #8
0
        /// <summary>
        /// Switches the screen to the combo selection screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CombosButton_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is Order o)
            {
                if (sender is Button)
                {
                    EbonyWarriorEntourage    EWE = new EbonyWarriorEntourage();
                    ComboCustomizationScreen CCS = new ComboCustomizationScreen(EWE);
                    EWE.Screen = CCS;

                    BriarheartBurger BB = new BriarheartBurger();
                    BB.Screen  = new EntreeCustomizationScreen(BB);
                    EWE.Entree = BB;

                    DragonbornWaffleFries DWF = new DragonbornWaffleFries();
                    DWF.Screen = new SideCustomizationScreen(DWF);
                    EWE.Side   = DWF;

                    SailorSoda SS = new SailorSoda();
                    SS.Screen = new DrinkCustomizationScreen(SS);
                    EWE.Drink = SS;

                    o.AddItem = EWE;

                    var orderControl = this.FindAncestor <OrderControl>();
                    orderControl?.SwapScreen(CCS);

                    if (orderControl.NavigationTabBorder.Child is NavigationTab NavTab)
                    {
                        NavTab.EWEScreen = EWE.Screen;
                        NavTab.ReturnToItemSelectionScreenBorder.Visibility = Visibility.Hidden;
                        NavTab.ReturnToCurrentComboScreenBorder.Visibility  = Visibility.Visible;
                    }
                    else
                    {
                        throw new NotImplementedException("Should never be reached");
                    }
                }
            }
        }
Exemple #9
0
        /// <summary>
        /// event handler that switches screens between home screen and item customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void onSwitchScreen(object sender, RoutedEventArgs e)
        {
            //if (DataContext is Order newOrder)
            //{
            var buttons = (Button)sender;

            switch (buttons.ToString())
            {
            case "System.Windows.Controls.Button: Briarheart Burger":
                BriarheartBurger newbb = new BriarheartBurger();
                Ancestor.newOrder.Add(newbb);
                Ancestor.SwitchScreen(Screen.custBriarheartBurger, newbb);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Double Draugr":
                DoubleDraugr newdd = new DoubleDraugr();
                Ancestor.newOrder.Add(newdd);
                Ancestor.SwitchScreen(Screen.custDoubleDraugr, newdd);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Garden Orc Omelette":
                GardenOrcOmelette newgoc = new GardenOrcOmelette();
                Ancestor.newOrder.Add(newgoc);
                Ancestor.SwitchScreen(Screen.custGardenOrcOmelette, newgoc);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Philly Poacher":
                PhillyPoacher newpp = new PhillyPoacher();
                Ancestor.newOrder.Add(newpp);
                Ancestor.SwitchScreen(Screen.custPhillyPoacher, newpp);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Smokehouse Skeleton":
                SmokehouseSkeleton newss = new SmokehouseSkeleton();
                Ancestor.newOrder.Add(newss);
                Ancestor.SwitchScreen(Screen.custSmokehouseSkeleton, newss);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Thalmor Triple":
                ThalmorTriple newtt = new ThalmorTriple();
                Ancestor.newOrder.Add(newtt);
                Ancestor.SwitchScreen(Screen.custThalmorTriple, newtt);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Dragonborn Waffle Fries":
                DragonbornWaffleFries newdwf = new DragonbornWaffleFries();
                Ancestor.newOrder.Add(newdwf);
                Ancestor.SwitchScreen(Screen.custDragonbornWaffleFries, newdwf);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Fried Miraak":
                FriedMiraak newfm = new FriedMiraak();
                Ancestor.newOrder.Add(newfm);
                Ancestor.SwitchScreen(Screen.custFriedMiraak, newfm);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Mad Otar Grits":
                MadOtarGrits newmog = new MadOtarGrits();
                Ancestor.newOrder.Add(newmog);
                Ancestor.SwitchScreen(Screen.custMadOtarGrits, newmog);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Vokun Salad":
                VokunSalad newvs = new VokunSalad();
                Ancestor.newOrder.Add(newvs);
                Ancestor.SwitchScreen(Screen.custVokunSalad, newvs);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Aretino Apple Juice":
                AretinoAppleJuice newaa = new AretinoAppleJuice();
                Ancestor.newOrder.Add(newaa);
                Ancestor.SwitchScreen(Screen.custAretinoAppleJuice, newaa);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Candlehearth Coffee":
                CandlehearthCoffee newcc = new CandlehearthCoffee();
                Ancestor.newOrder.Add(newcc);
                Ancestor.SwitchScreen(Screen.custCandlehearthCoffee, newcc);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Markarth Milk":
                MarkarthMilk newmm = new MarkarthMilk();
                Ancestor.newOrder.Add(newmm);
                Ancestor.SwitchScreen(Screen.custMarkarthMilk, newmm);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Sailor Soda":
                SailorSoda newsoda = new SailorSoda();
                Ancestor.newOrder.Add(newsoda);
                Ancestor.SwitchScreen(Screen.custSailorSoda, newsoda);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Warrior Water":
                WarriorWater newww = new WarriorWater();
                Ancestor.newOrder.Add(newww);
                Ancestor.SwitchScreen(Screen.custWarriorWater, newww);
                DisplayCurrentOrder();
                break;

            case "System.Windows.Controls.Button: Complete Order":
                Ancestor.SwitchScreen(Screen.completeOrder);
                break;
            }
            DisplayCurrentOrder();

            //}
        }
        /// <summary>
        /// Add item to order list
        /// </summary>
        /// <param name="sender">button</param>
        /// <param name="e">press</param>
        private void OrderItem(object sender, RoutedEventArgs e)
        {
            switch (StringGetter)
            {
            case "briarheartBurger":
                BriarheartBurger entree = new BriarheartBurger();
                if (bun.IsChecked == true)
                {
                    entree.Bun = false;
                }
                if (ketchup.IsChecked == true)
                {
                    entree.Ketchup = false;
                }
                if (mustard.IsChecked == true)
                {
                    entree.Mustard = false;
                }
                if (pickle.IsChecked == true)
                {
                    entree.Pickle = false;
                }
                if (cheese.IsChecked == true)
                {
                    entree.Cheese = false;
                }
                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = entree;
                }
                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(entree);
                }

                return;

            case "doubleDraugr":
                DoubleDraugr draugr = new DoubleDraugr();
                if (bun.IsChecked == true)
                {
                    draugr.Bun = false;
                }
                if (ketchup.IsChecked == true)
                {
                    draugr.Ketchup = false;
                }
                if (mustard.IsChecked == true)
                {
                    draugr.Mustard = false;
                }
                if (pickle.IsChecked == true)
                {
                    draugr.Pickle = false;
                }
                if (cheese.IsChecked == true)
                {
                    draugr.Cheese = false;
                }
                if (tomato.IsChecked == true)
                {
                    draugr.Tomato = false;
                }
                if (lettuce.IsChecked == true)
                {
                    draugr.Lettuce = false;
                }
                if (mayo.IsChecked == true)
                {
                    draugr.Mayo = false;
                }
                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = draugr;
                }

                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(draugr);
                }

                return;


            case "gardenOrcOmelette":
                GardenOrcOmelette omellette = new GardenOrcOmelette();
                if (broccoli.IsChecked == true)
                {
                    omellette.Broccoli = false;
                }
                if (mushroom.IsChecked == true)
                {
                    omellette.Mushrooms = false;
                }
                if (tomato.IsChecked == true)
                {
                    omellette.Tomato = false;
                }
                if (cheddar.IsChecked == true)
                {
                    omellette.Cheddar = false;
                }
                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = omellette;
                }



                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(omellette);
                }

                return;

            case "phillyPoacher":

                PhillyPoacher philly = new PhillyPoacher();
                if (sirloin.IsChecked == true)
                {
                    philly.Sirloin = false;
                }
                if (onion.IsChecked == true)
                {
                    philly.Onion = false;
                }
                if (roll.IsChecked == true)
                {
                    philly.Roll = false;
                }



                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = philly;
                }

                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(philly);
                }

                return;

            case "smokeHouseSkeleton":

                SmokehouseSkeleton house = new SmokehouseSkeleton();
                if (hashBrowns.IsChecked == true)
                {
                    house.HashBrowns = false;
                }
                if (sausage.IsChecked == true)
                {
                    house.SausageLink = false;
                }
                if (pancakes.IsChecked == true)
                {
                    house.Pancake = false;
                }
                if (eggs.IsChecked == true)
                {
                    house.Egg = false;
                }

                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = house;
                }


                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(house);
                }
                return;


            case "thalmorTriple":

                ThalmorTriple thalmor = new ThalmorTriple();
                if (bun.IsChecked == true)
                {
                    thalmor.Bun = false;
                }
                if (ketchup.IsChecked == true)
                {
                    thalmor.Ketchup = false;
                }
                if (mustard.IsChecked == true)
                {
                    thalmor.Mustard = false;
                }
                if (pickle.IsChecked == true)
                {
                    thalmor.Pickle = false;
                }
                if (cheese.IsChecked == true)
                {
                    thalmor.Cheese = false;
                }
                if (tomato.IsChecked == true)
                {
                    thalmor.Tomato = false;
                }
                if (lettuce.IsChecked == true)
                {
                    thalmor.Lettuce = false;
                }
                if (mayo.IsChecked == true)
                {
                    thalmor.Mayo = false;
                }
                if (eggs.IsChecked == true)
                {
                    thalmor.Egg = false;
                }
                if (bacon.IsChecked == true)
                {
                    thalmor.Bacon = false;
                }


                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = thalmor;
                }

                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(thalmor);
                }
                return;

            case "thugsTbone":
                ThugsTBone bone = new ThugsTBone();

                if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null)
                {
                    (Application.Current.MainWindow as MainWindow).Combo.Entree = bone;
                }

                else
                {
                    (Application.Current.MainWindow as MainWindow).curOrder.Add(bone);
                }
                return;
            }
        }
Exemple #11
0
        /// <summary>
        /// Handles briarheart burger button click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void briarheartBurger_Click(object sender, RoutedEventArgs e)
        {
            BriarheartBurger b = new BriarheartBurger(parent, this, order);

            parent.containerBorder.Child = b;
        }
Exemple #12
0
 /// <summary>
 /// Override to create a menu to modify an existing item
 /// </summary>
 /// <param name="ancestor">Menu of which this is a child</param>
 /// <param name="item">Existing item to be modified</param>
 public BriarheartMenu(MenuComponent ancestor, BriarheartBurger item)
 {
     InitializeComponent();
     Ancestor         = ancestor;
     this.DataContext = item;
 }
        /// <summary>
        /// Burger click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void BrairheartBurgerClick(object sender, RoutedEventArgs e)
        {
            BriarheartBurger burg = new BriarheartBurger();

            o.pageDisplay.Child = new CustomizationBriarheartBurger(o, burg);
        }
Exemple #14
0
 public BriarheartBurgerOrder(OrderMenu menu, BriarheartBurger burger)
 {
     InitializeComponent();
     parent      = menu;
     DataContext = burger;
 }
Exemple #15
0
        // Edit item click event handler
        private void EditItemClick(object sender, SelectionChangedEventArgs e)
        {
            if (OrderList.SelectedItem == null)
            {
                return;
            }

            DependencyObject parent = this;

            do
            {
                parent = LogicalTreeHelper.GetParent(parent);
            } while (!(parent is MainWindow || parent is null));

            if (parent is MainWindow menu)
            {
                string itemString = OrderList.SelectedItem.ToString();

                if (itemString.Contains("Briarheart Burger"))
                {
                    BriarheartBurger item = e.AddedItems[0] as BriarheartBurger;
                    if (DataContext is Order order)
                    {
                        var screen = new BriarheartBurgerCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Double Draugr"))
                {
                    DoubleDraugr item = e.AddedItems[0] as DoubleDraugr;
                    if (DataContext is Order order)
                    {
                        var screen = new DoubleDraugrCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Thalmor Triple"))
                {
                    ThalmorTriple item = e.AddedItems[0] as ThalmorTriple;
                    if (DataContext is Order order)
                    {
                        var screen = new ThalmorTripleCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Garden Orc Omelette"))
                {
                    GardenOrcOmelette item = e.AddedItems[0] as GardenOrcOmelette;
                    if (DataContext is Order order)
                    {
                        var screen = new GardenOrcOmeletteCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Philly Poacher"))
                {
                    PhillyPoacher item = e.AddedItems[0] as PhillyPoacher;
                    if (DataContext is Order order)
                    {
                        var screen = new PhillyPoacherCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Smokehouse Skeleton"))
                {
                    SmokehouseSkeleton item = e.AddedItems[0] as SmokehouseSkeleton;
                    if (DataContext is Order order)
                    {
                        var screen = new SmokehouseSkeletonCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Thugs T-Bone"))
                {
                    ThugsTBone item = e.AddedItems[0] as ThugsTBone;
                    if (DataContext is Order order)
                    {
                        var screen = new ThugsTBoneCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Dragonborn Waffle Fries"))
                {
                    DragonbornWaffleFries item = e.AddedItems[0] as DragonbornWaffleFries;
                    if (DataContext is Order order)
                    {
                        var screen = new DragonbornWaffleFriesCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Fried Miraak"))
                {
                    FriedMiraak item = e.AddedItems[0] as FriedMiraak;
                    if (DataContext is Order order)
                    {
                        var screen = new FriedMiraakCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Mad Otar Grits"))
                {
                    MadOtarGrits item = e.AddedItems[0] as MadOtarGrits;
                    if (DataContext is Order order)
                    {
                        var screen = new MadOtarGritsCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Vokun Salad"))
                {
                    VokunSalad item = e.AddedItems[0] as VokunSalad;
                    if (DataContext is Order order)
                    {
                        var screen = new VokunSaladCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Arentino Apple Juice"))
                {
                    ArentinoAppleJuice item = e.AddedItems[0] as ArentinoAppleJuice;
                    if (DataContext is Order order)
                    {
                        var screen = new ArentinoAppleJuiceCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Candlehearth Coffee"))
                {
                    CandlehearthCoffee item = e.AddedItems[0] as CandlehearthCoffee;
                    if (DataContext is Order order)
                    {
                        var screen = new CandlehearthCoffeeCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Markarth Milk"))
                {
                    MarkarthMilk item = e.AddedItems[0] as MarkarthMilk;
                    if (DataContext is Order order)
                    {
                        var screen = new MarkarthMilkCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Sailor Soda"))
                {
                    SailorSoda item = e.AddedItems[0] as SailorSoda;
                    if (DataContext is Order order)
                    {
                        var screen = new SailorSodaCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }

                if (itemString.Contains("Warrior Water"))
                {
                    WarriorWater item = e.AddedItems[0] as WarriorWater;
                    if (DataContext is Order order)
                    {
                        var screen = new WarriorWaterCustom();
                        screen.DataContext       = item;
                        menu.displayBorder.Child = screen;
                    }
                }
            }
        }
Exemple #16
0
        /// <summary>
        /// Takes the button selection for a menu item and updates screen to that items customization menu
        /// </summary>
        /// <param name="sender">Button</param>
        /// <param name="e">Event</param>
        public void MenuButtonPress(object sender, RoutedEventArgs e)
        {
            if (DataContext is Order orderX)
            {
                var              o = this.FindAncestor <OrderControl>();
                IOrderItem       choice;
                FrameworkElement display;
                switch ((sender as Button).Name)
                {
                case "burger":
                    display = new BriarheartBurgerCustom();
                    choice  = new BriarheartBurger();
                    break;

                case "draugr":
                    display = new DoubleDraugrCustom();
                    choice  = new DoubleDraugr();
                    break;

                case "triple":
                    display = new ThalmorTripleCustom();
                    choice  = new ThalmorTriple();
                    break;

                case "skeleton":
                    display = new SmokehousrSkeletonCustom();
                    choice  = new SmokehouseSkeleton();
                    break;

                case "omelette":
                    display = new GardenOrcOmeletteCustom();
                    choice  = new GardenOrcOmelette();
                    break;

                case "poacher":
                    display = new PhillyPoacherCustom();
                    choice  = new PhillyPoacher();
                    break;

                case "t_bone":
                    display = new NoCustom();
                    choice  = new ThugsTBone();
                    break;

                case "salad":
                    SideCustom salad = new SideCustom();
                    salad.Title.Text = "Vokun Salad Customization";
                    display          = salad;
                    choice           = new VokunSalad();
                    break;

                case "miraak":
                    SideCustom miraak = new SideCustom();
                    miraak.Title.Text = "Fried Miraak Customization";
                    display           = miraak;
                    choice            = new FriedMiraak();
                    break;

                case "grits":
                    SideCustom grits = new SideCustom();
                    grits.Title.Text = "Mad Otar Grits Customization";
                    display          = grits;
                    choice           = new MadOtarGrits();
                    break;

                case "fries":
                    SideCustom fries = new SideCustom();
                    fries.Title.Text = "DragonBorn Waffle Fries Customization";
                    display          = fries;
                    choice           = new DragonbornWaffleFries();
                    break;

                case "water":
                    display = new WarriorWaterCustom();
                    choice  = new WarriorWater();
                    break;

                case "soda":
                    display = new SailorSodaCustom();
                    choice  = new SailorSoda();
                    break;

                case "coffee":
                    display = new CandlehearthCoffeeCustom();
                    choice  = new CandlehearthCoffee();
                    break;

                case "milk":
                    display = new MarkarthMilkCustom();
                    choice  = new MarkarthMilk();
                    break;

                case "juice":
                    display = new ArentinoAppleJuiceCustom();
                    choice  = new AretinoAppleJuice();
                    break;

                case "ComboCreate":
                    display = new ComboCustom();
                    choice  = new Combo();
                    break;

                default:
                    display = new MenuSelection();
                    choice  = null;
                    break;
                }


                display.DataContext = choice;
                choice.Display      = display;
                o?.DisplayUpdate(display);
            }
        }