// A click event handler for the Arentino Apple Juice button
        void AddArentinoAppleJuice(object sender, RoutedEventArgs e)
        {
            var screen = new ArentinoAppleJuiceCustom();
            ArentinoAppleJuice temp = new ArentinoAppleJuice();

            menuBorder.Child   = screen;
            screen.DataContext = temp;
            if (DataContext is Order order)
            {
                order.Add(temp);
            }
        }
        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);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles arentino apple juice button click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void arentinoAppleJuice_Click(object sender, RoutedEventArgs e)
        {
            ArentinoAppleJuice a = new ArentinoAppleJuice(parent, this, order);

            parent.containerBorder.Child = a;
        }
Exemplo n.º 4
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;
                    }
                }
            }
        }