//does inital setup private void Setup() { PizzaController.CreatePizza(1, "Margherita", Pizza.PizzaSize.Normal, Pizza.PizzaDough.Wheat, Pizza.PizzaSauce.Tomato, new ObservableCollection <Topping> { new Topping("Cheese"), new Topping("Oregano") }); PizzaController.CreatePizza(2, "Vesuvio", Pizza.PizzaSize.Familiy, Pizza.PizzaDough.Wheat, Pizza.PizzaSauce.Tomato, new ObservableCollection <Topping> { new Topping("Cheese"), new Topping("Oregano"), new Topping("Ham") }); PizzaController.CreatePizza(3, "Capricciosa", Pizza.PizzaSize.Normal, Pizza.PizzaDough.Wheat, Pizza.PizzaSauce.Tomato, new ObservableCollection <Topping> { new Topping("Cheese"), new Topping("Oregano"), new Topping("Ham"), new Topping("Mushrooms") }); PizzaController.CreatePizza(4, "Make Your Own", Pizza.PizzaSize.Normal, Pizza.PizzaDough.Wheat, Pizza.PizzaSauce.Tomato, new ObservableCollection <Topping>()); UpdateComboBoxes(PresetCombobox); Cart.ItemsSource = PizzaController.OrderList; }
private void Worker_DoWork(object sender, DoWorkEventArgs e) { int waitTime = (int)e.Argument; while (true) { Thread.Sleep(waitTime); ObservableCollection <Pizza> temp = PizzaController.PizzaList; App.Current.Dispatcher.Invoke(delegate { PresetDrinkPrice = Drink.DispalyPrice((Drink.DrinkSize)DrinkSizeBox.SelectedItem); PizzaPrice = DisplayPizzaPrice(); Discount = PizzaController.DiscountCheck(); TotalPrice = PizzaController.OrderPrice; }); } }