public void OnItemAddEntreeClicked(object sender, RoutedEventArgs e)
        {
            IOrderItem entree;
            var        orderControl = this.FindAncestor <OrderControl>();

            if (DataContext is Order order)
            {
                if (sender is Button button)
                {
                    switch (button.Name)
                    {
                    case "AddCowPokeChilli":
                        entree = new CowpokeChili();
                        var screen = new CustomizeEntree();
                        screen.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen);
                        screen.Title.Text = "Customize Cowpoke Chilli";
                        screen.ChilliMenu();
                        break;

                    case "AddRustlersRibs":
                        entree = new RustlersRibs();
                        var screen2 = new CustomizeEntree();
                        screen2.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen2);
                        screen2.Title.Text = "Customize Rustler's Ribs";
                        break;

                    case "AddPecosPulledPork":
                        entree = new PecosPulledPork();
                        var screen3 = new CustomizeEntree();
                        screen3.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen3);
                        screen3.Title.Text = "Customize Pecos Pulled Pork";
                        screen3.PecosPulledPork();
                        break;

                    case "AddTrailBurger":
                        entree = new TrailBurger();
                        var screen4 = new CustomizeEntree();
                        screen4.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen4);
                        screen4.Title.Text = "Customize Trail Burger";
                        screen4.TrailBurger();
                        break;

                    case "DakotaDoubleBurger":
                        entree = new DakotaDoubleBurger();
                        var screen5 = new CustomizeEntree();
                        screen5.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen5);
                        screen5.Title.Text = "Customize Dakota Double Burger";
                        screen5.DakotaDouble();
                        break;

                    case "AddTexasTripleBurger":
                        entree = new TexasTripleBurger();
                        var screen6 = new CustomizeEntree();
                        screen6.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen6);
                        screen6.Title.Text = "Customize Texas Triple Burger";
                        screen6.TexasTriple();
                        break;

                    case "AddAngryChicken":
                        entree = new AngryChicken();
                        var screen7 = new CustomizeEntree();
                        screen7.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen7);
                        screen7.Title.Text = "Customize Angry Chicken";
                        screen7.AngryChickenMenu();
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void OnItemSelectChange(object sender, SelectionChangedEventArgs e)
        {
            var Control = this.FindAncestor <OrderControl>();

            if (Control == null)
            {
                return;
            }

            foreach (object Item in e.AddedItems)
            {
                if (Item is CowpokeChili)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Cowpoke Chilli";
                    cpc.ChilliMenu();
                }
                else if (Item is AngryChicken)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Angry Chicken";
                    cpc.AngryChickenMenu();
                }
                else if (Item is DakotaDoubleBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Dakota Double Burger";
                    cpc.DakotaDouble();
                }
                else if (Item is PecosPulledPork)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Pecos Pulled Pork";
                    cpc.PecosPulledPork();
                }
                else if (Item is RustlersRibs)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Rustler's Ribs";
                }
                else if (Item is TrailBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Trail Burger";
                    cpc.TrailBurger();
                }
                else if (Item is TexasTripleBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Texas Triple Burger";
                    cpc.TexasTriple();
                }
                else if (Item is BakedBeans)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Baked Beans";
                }
                else if (Item is ChiliCheeseFries)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Chilli Cheese Fries";
                }
                else if (Item is PanDeCampo)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Pan De Campo";
                }
                else if (Item is CornDodgers)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Corn Dodgers";
                }
                else if (Item is JerkedSoda)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Jerked Soda";
                    cpc.SodaMenu();
                }
                else if (Item is CowboyCoffee)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Cowboy Coffee";
                    cpc.CoffeeMenu();
                }
                else if (Item is Water)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Water";
                    cpc.WaterMenu();
                }
                else if (Item is TexasTea)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Texas Tea";
                    cpc.TeaMenu();
                }
            }
        }