private void Button_Click_1(object sender, RoutedEventArgs e) { (order.OrderLists.Children[childVal] as OrderList).addItem(food); Food foodS = ((this.Parent as Grid).Parent as Food); Drink drinkS = ((this.Parent as Grid).Parent as Drink); CustomizePizza pizzaS = ((this.Parent as Grid).Parent as CustomizePizza); if (foodS != null) { foodS.changeToOrder(); foodS.Page.Children.Remove(cover); foodS.Page.Children.Remove(this); } if (drinkS != null) { drinkS.changeToOrder(); drinkS.Page.Children.Remove(cover); drinkS.Page.Children.Remove(this); } if (pizzaS != null) { pizzaS.changeToOrder(); pizzaS.Page.Children.Remove(cover); pizzaS.Page.Children.Remove(this); pizzaS.backToHome(); } }
private void resizeTabs(object sender, SizeChangedEventArgs e) { Order ol = (frame2.Content as Order); ol.nav = this; var quarterWidth = (tabControl.ActualWidth / 4) - 1.5; var tenthHeight = (tabControl.ActualHeight / 20); foodTab.Width = quarterWidth; foodTab.Height = tenthHeight; foodE.Width = quarterWidth * 2; foodE.Height = 3 * tenthHeight; foodE.Margin = new Thickness(-quarterWidth, -tenthHeight * 1.6, 0, 0); foodTab.FontSize = this.ActualHeight * 0.04; Food food = (frame3.Content as Food); CustomizePizza pizza = (frame3.Content as CustomizePizza); if (food != null) { (frame3.Content as Food).order = ol; (frame3.Content as Food).nav = this; } else if (pizza != null) { (frame3.Content as CustomizePizza).order = ol; } drinkTab.Width = tabControl.ActualWidth / 4; drinkE.Width = quarterWidth + 4; drinkE.Height = 3 * tenthHeight; drinkE.Margin = new Thickness(quarterWidth - 2, -tenthHeight * 1.6, 0, 0); drinkTab.FontSize = this.ActualHeight * 0.04; (frame1.Content as Drink).order = ol; (frame1.Content as Drink).nav = this; specTab.Width = quarterWidth; specE.Width = quarterWidth + 4; specE.Height = 3 * tenthHeight; specE.Margin = new Thickness(2 * quarterWidth - 2, -tenthHeight * 1.6, 0, 0); specTab.FontSize = this.ActualHeight * 0.04; orderTab.Width = quarterWidth; orderE.Width = quarterWidth * 2; orderE.Height = 3 * tenthHeight; orderE.Margin = new Thickness(quarterWidth * 3, -tenthHeight * 1.6, 0, 0); orderTab.FontSize = this.ActualHeight * 0.04; (frame.Content as Specials).nav = this; CallServerEllipse.Width = quarterWidth * 2; CallServerEllipse.Height = 4 * tenthHeight; CallServerEllipse.Margin = new Thickness(quarterWidth * 3, this.ActualHeight - (tenthHeight * 3), 0, 0); CallServerButton.Width = quarterWidth; CallServerButton.Height = tenthHeight; CallServerButton.Margin = new Thickness(quarterWidth * 3, this.ActualHeight - (tenthHeight), 0, 0); CallServerButton.FontSize = this.ActualHeight * 0.04; }
private void Button_Click(object sender, RoutedEventArgs e) { if (food.isMod) { for (int j = 0; j < food.ingredients.Length; j++) { food.Price += food.ingredients[j].cost; if (food.ingredients[j].mod == true || food.ingredients[j].quantity != "Regular") { food.title += " + " + food.ingredients[j].quantity + " " + food.ingredients[j].name; } } } (order.OrderLists.Children[childVal] as OrderList).addItem(food); Food foodS = ((this.Parent as Grid).Parent as Food); Drink drinkS = ((this.Parent as Grid).Parent as Drink); CustomizePizza pizzaS = ((this.Parent as Grid).Parent as CustomizePizza); if (foodS != null) { foodS.Page.Children.Remove(cover); foodS.Page.Children.Remove(this); } if (drinkS != null) { drinkS.Page.Children.Remove(cover); drinkS.Page.Children.Remove(this); } if (pizzaS != null) { pizzaS.Page.Children.Remove(cover); pizzaS.Page.Children.Remove(this); pizzaS.backToHome(); } // (this.Parent as Food).Page.Children.Remove(this); // this.Parent.Page.Controls.Remove(this); }
private void Mf_MouseDoubleClick(object sender, MouseButtonEventArgs e) { MenuFoodItem item = sender as MenuFoodItem; if (item != null) { Console.WriteLine("Double clicked1"); Frame parent = Parent as Frame; CustomizePizza customize = new CustomizePizza(); customize.order = order; customize.pizza = item.menuItem; customize.nav = nav; NavigationService.Navigate(customize); if (parent != null) { Console.WriteLine("Double clicked2"); parent.Source = new Uri("CustomizePizza.xaml", UriKind.Relative); } //item.menuItem } }