Example #1
0
        /// <summary>
        /// event handler for the tbone button changes screen to tbone customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void TBoneButton(object sender, RoutedEventArgs e)
        {
            ThugsT_Bone        ttb   = new ThugsT_Bone();
            TBoneCustomization tbc   = new TBoneCustomization(ttb);
            OrderWindow        order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(ttb);
            }
            order.Swap(tbc);
        }
 void EditItem(object sender, RoutedEventArgs e)
 {
     if (DataContext is Order order)
     {
         if (sender is Button button)
         {
             if (button.DataContext is IOrderItem item)
             {
                 if (item is BriarheartBurger bb)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(bb, 0);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is DoubleDraugr dd)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(dd, 1);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is ThalmorTriple tt)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(tt, 2);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is GardenOrcOmelette goo)
                 {
                     OmeletteCustomization bc        = new OmeletteCustomization(goo);
                     OrderWindow           orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is PhillyPoacher pp)
                 {
                     PoacherCustomization bc        = new PoacherCustomization(pp);
                     OrderWindow          orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is SmokehouseSkeleton shs)
                 {
                     SkeletonCustomization bc        = new SkeletonCustomization(shs);
                     OrderWindow           orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is ThugsT_Bone ttb)
                 {
                     TBoneCustomization bc        = new TBoneCustomization(ttb);
                     OrderWindow        orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is DragonbornWaffleFries dwf)
                 {
                     SizeCustomization bc        = new SizeCustomization(5, dwf);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is FriedMiraak fm)
                 {
                     SizeCustomization bc        = new SizeCustomization(6, fm);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is MadOtarGrits mog)
                 {
                     SizeCustomization bc        = new SizeCustomization(7, mog);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is VokunSalad vs)
                 {
                     SizeCustomization bc        = new SizeCustomization(8, vs);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is AretinoAppleJuice aj)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(aj, 3);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is CandlehearthCoffee chc)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(chc, 1);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is MarkarthMilk mm)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(mm, 4);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is SailorSoda ss)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(ss, 0);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is WarriorWater ww)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(ww, 2);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
             }
         }
     }
 }