/// <summary> /// Handles fried miraak button click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void friedMiraak_Click(object sender, RoutedEventArgs e) { FriedMiraak f = new FriedMiraak(parent, this, order); parent.containerBorder.Child = f; }
/// <summary> /// Fried Miraak click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void FriedMiraakClick(object sender, RoutedEventArgs e) { FriedMiraak fried = new FriedMiraak(); o.pageDisplay.Child = new CustomFriedMiraak(o, fried); }
/// <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); } }
// 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; } } } }
/// <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 FriedMiraakMenu(MenuComponent ancestor, FriedMiraak item) { InitializeComponent(); Ancestor = ancestor; this.DataContext = item; }