/// <summary>
        /// Click event for vokunSaladButton. Opens vokun salad 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 OpenVokunSaladCustomization(object sender, RoutedEventArgs e)
        {
            var vsCustomization = new VokunSaladCustomization((Order)this.DataContext, false, null);

            fullMenuSelectionGrid.Children.Clear();
            VokunSalad vs = new VokunSalad();

            ((Order)this.DataContext).Add(vs);
            vsCustomization.DataContext = vs;
            fullComponentBorder.Child   = vsCustomization;
        }
 /// <summary>
 /// Click event for vokunSaladButton. Opens vokun salad 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 OpenVokunSaladCustomization(object sender, RoutedEventArgs e)
 {
     if (((Combo)this.DataContext).Side is VokunSalad oldvs)
     {
         var vsCustomization = new VokunSaladCustomization(currentOrder, true, (Combo)this.DataContext);
         vsCustomization.DataContext = oldvs;
         fullComponentBorder.Child   = vsCustomization;
     }
     else
     {
         var        vsCustomization = new VokunSaladCustomization(currentOrder, true, (Combo)this.DataContext);
         VokunSalad vs = new VokunSalad();
         ((Combo)this.DataContext).Side = vs;
         vsCustomization.DataContext    = vs;
         fullComponentBorder.Child      = vsCustomization;
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// this class sets a new instance of the
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">represents a food object passed from FoodSelected event handler</param>
        public void FoodButtonClickEvent(object sender, MenuSelectionEvent e)
        {
            //now how can we use the information from Custimization...
            //to make changes to e.fooditem which is the new BriarheartBurger()
            //final goal ->   use BriarheartBurger.SpecialInstructions

            //we need to find a better way of capturing fooditem's customization information
            //FinalOrderListView.Items.Add("Briarheart Burger");

            //entrees
            if (e.fooditem is BriarheartBurger) // this will check if an object is a certain type
            {
                BriarheartBurgerCustomization fooditem = new BriarheartBurgerCustomization(e.fooditem);
                switchBorder.Child   = fooditem; //add burger customization to the current screen
                fooditem.DataContext = e.fooditem;

                //fooditem.DataContext = e.fooditem; //allows the DataContext of the XAML variables to access BriarheartBurger
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is DoubleDraugr) // this will check if an object is a certain type
            {
                DoubleDraugrCustomization fooditem = new DoubleDraugrCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                // fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is ThalmorTriple) // this will check if an object is a certain type
            {
                ThalmorTripleCustomization fooditem = new ThalmorTripleCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is SmokehouseSkeleton) // this will check if an object is a certain type
            {
                SmokehouseSkeletonCustomization fooditem = new SmokehouseSkeletonCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is GardenOrcOmelette) // this will check if an object is a certain type
            {
                GardenOrcOmeletteCustomization fooditem = new GardenOrcOmeletteCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is PhillyPoacher) // this will check if an object is a certain type
            {
                PhillyPoacherCustomization fooditem = new PhillyPoacherCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            else if (e.fooditem is ThugsTBone) // this will check if an object is a certain type
            {
                ThugsTBoneCustomization fooditem = new ThugsTBoneCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }


            //drinks
            else if (e.fooditem is SailorSoda)
            {
                SailorSodaCustomization fooditem = new SailorSodaCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is MarkarthMilk)
            {
                MarkarthMilkCustomization fooditem = new MarkarthMilkCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                // fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is AretinoAppleJuice)
            {
                AretinoAppleJuiceCustomization fooditem = new AretinoAppleJuiceCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is CandlehearthCoffee)
            {
                CandlehearthCoffeeCustomization fooditem = new CandlehearthCoffeeCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is WarriorWater)
            {
                WarriorWaterCustomization fooditem = new WarriorWaterCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }

            //sides:
            else if (e.fooditem is VokunSalad)
            {
                VokunSaladCustomization fooditem = new VokunSaladCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is FriedMiraak)
            {
                FriedMiraakCustomization fooditem = new FriedMiraakCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is MadOtarGrits)
            {
                MadOtarGritsCustomization fooditem = new MadOtarGritsCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
            }
            else if (e.fooditem is DragonbornWaffleFries)
            {
                DragonbornWaffleFriesCustomization fooditem = new DragonbornWaffleFriesCustomization(e.fooditem);
                switchBorder.Child   = fooditem;
                fooditem.DataContext = e.fooditem;
                //fooditem.DataContext = newOrder;
                //finalOrder.Add(e.fooditem); //only need once below
            }

            // finalOrder.Add(e.fooditem); //add food item to the list of IOrderItem

            newOrder.Add(e.fooditem); //setting everything up for newOrder

            DisplayCurrentOrder();
        }
        /// <summary>
        /// Event when an item in the order list is selected. Opens the customization screen for that item.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event</param>
        /// <param name="e">Contains the event data.</param>
        void ChangeItemSelected(object sender, SelectionChangedEventArgs e)
        {
            var item = orderList.SelectedItem;

            if (item is Combo co)
            {
                ComboCustomization coc = new ComboCustomization((Order)this.DataContext);
                coc.DataContext = co;
                mscBorder.Child = coc;
            }
            else if (item is AretinoAppleJuice aj)
            {
                AretinoAppleJuiceCustomization ajc = new AretinoAppleJuiceCustomization(((Order)this.DataContext), false, null);
                ajc.DataContext = aj;
                mscBorder.Child = ajc;
            }
            else if (item is CandlehearthCoffee cc)
            {
                CandlehearthCoffeeCustomization ccc = new CandlehearthCoffeeCustomization(((Order)this.DataContext), false, null);
                ccc.DataContext = cc;
                mscBorder.Child = ccc;
            }
            else if (item is MarkarthMilk mm)
            {
                MarkarthMilkCustomization mmc = new MarkarthMilkCustomization(((Order)this.DataContext), false, null);
                mmc.DataContext = mm;
                mscBorder.Child = mmc;
            }
            else if (item is SailorSoda ss)
            {
                SailorSodaCustomization ssc = new SailorSodaCustomization(((Order)this.DataContext), false, null);
                ssc.DataContext = ss;
                mscBorder.Child = ssc;
            }
            else if (item is WarriorWater ww)
            {
                WarriorWaterCustomization wwc = new WarriorWaterCustomization(((Order)this.DataContext), false, null);
                wwc.DataContext = ww;
                mscBorder.Child = wwc;
            }
            else if (item is BriarheartBurger bb)
            {
                BriarheartBurgerCustomization bbc = new BriarheartBurgerCustomization(((Order)this.DataContext), false, null);
                bbc.DataContext = bb;
                mscBorder.Child = bbc;
            }
            else if (item is DoubleDraugr dd)
            {
                DoubleDraugrCustomization ddc = new DoubleDraugrCustomization(((Order)this.DataContext), false, null);
                ddc.DataContext = dd;
                mscBorder.Child = ddc;
            }
            else if (item is GardenOrcOmelette goo)
            {
                GardenOrcOmeletteCustomization gooc = new GardenOrcOmeletteCustomization(((Order)this.DataContext), false, null);
                gooc.DataContext = goo;
                mscBorder.Child  = gooc;
            }
            else if (item is PhillyPoacher pp)
            {
                PhillyPoacherCustomization ppc = new PhillyPoacherCustomization(((Order)this.DataContext), false, null);
                ppc.DataContext = pp;
                mscBorder.Child = ppc;
            }
            else if (item is SmokehouseSkeleton sms)
            {
                SmokehouseSkeletonCustomization smsc = new SmokehouseSkeletonCustomization(((Order)this.DataContext), false, null);
                smsc.DataContext = sms;
                mscBorder.Child  = smsc;
            }
            else if (item is ThalmorTriple tt)
            {
                ThalmorTripleCustomization ttc = new ThalmorTripleCustomization(((Order)this.DataContext), false, null);
                ttc.DataContext = tt;
                mscBorder.Child = ttc;
            }
            else if (item is ThugsTBone ttb)
            {
                ThugsTBoneCustomization ttbc = new ThugsTBoneCustomization(((Order)this.DataContext), false, null);
                ttbc.DataContext = ttb;
                mscBorder.Child  = ttbc;
            }
            else if (item is DragonbornWaffleFries dwf)
            {
                DragonbornWaffleFriesCustomization dwfc = new DragonbornWaffleFriesCustomization(((Order)this.DataContext), false, null);
                dwfc.DataContext = dwf;
                mscBorder.Child  = dwfc;
            }
            else if (item is FriedMiraak fm)
            {
                FriedMiraakCustomization fmc = new FriedMiraakCustomization(((Order)this.DataContext), false, null);
                fmc.DataContext = fm;
                mscBorder.Child = fmc;
            }
            else if (item is MadOtarGrits mog)
            {
                MadOtarGritsCustomization mogc = new MadOtarGritsCustomization(((Order)this.DataContext), false, null);
                mogc.DataContext = mog;
                mscBorder.Child  = mogc;
            }
            else if (item is VokunSalad vs)
            {
                VokunSaladCustomization vsc = new VokunSaladCustomization(((Order)this.DataContext), false, null);
                vsc.DataContext = vs;
                mscBorder.Child = vsc;
            }
        }