/// <summary> /// Shows chosen drink user control /// </summary> /// <param name="sender">button</param> /// <param name="e">press</param> public void ShowDrinkOptions(object sender, RoutedEventArgs e) { DrinkOptions drinkOption = new DrinkOptions(); string tess = ""; if (sender is Button) { drinkOption.StringGetter = (sender as Button).Name; } else if (sender is ListBox box) { drinkOption.modifier = true; tess = box.SelectedItem.ToString(); drinkOption.Item = (IOrderItem)(box.SelectedItem); drinkOption.ordering.Tag = box.SelectedItem; } if ((Application.Current.MainWindow as MainWindow).ComboChecker) { drinkOption.Combo.IsChecked = true; drinkOption.Combo.IsEnabled = false; } if (drinkOption.StringGetter == "candleHearthCoffee" || tess.Contains("Coffee")) { drinkOption.StringGetter = "candleHearthCoffee"; drinkOption.decaf.IsEnabled = true; drinkOption.cream.IsEnabled = true; } else if (drinkOption.StringGetter == "sailorSoda" || tess.Contains("Soda")) { drinkOption.StringGetter = "sailorSoda"; drinkOption.blackberry.IsEnabled = true; drinkOption.cherry.IsEnabled = true; drinkOption.cherry.IsChecked = true; drinkOption.lemon.IsEnabled = true; drinkOption.watermelon.IsEnabled = true; drinkOption.peach.IsEnabled = true; drinkOption.grapefruit.IsEnabled = true; drinkOption.ice.IsChecked = true; } else if (drinkOption.StringGetter == "warriorWater" || tess.Contains("Water")) { drinkOption.StringGetter = "warriorWater"; drinkOption.ice.IsChecked = true; } if (sender is Button) { (this.Parent as Border).Child = drinkOption; } else { (Application.Current.MainWindow as MainWindow).mainBorder.Child = drinkOption; } }
/// <summary> /// Event handler for markarth milk selection /// </summary> /// <param name="sender">control exectuting event</param> /// <param name="e">data for event</param> void MarkarthMilk(object sender, RoutedEventArgs e) { drink = new DrinkOptions(); containerBorder.Child = drink; MarkarthMilk mm = new MarkarthMilk(); drink.OrderList = OrderList; drink.DataContext = mm; drink.drink.Text = "Markarth Milk"; drink.ice.Visibility = Visibility.Visible; }
/// <summary> /// Event handler for aretino apple juice selection /// </summary> /// <param name="sender">control exectuting event</param> /// <param name="e">data for event</param> void AretinoAppleJuice(object sender, RoutedEventArgs e) { drink = new DrinkOptions(); containerBorder.Child = drink; AretinoAppleJuice aj = new AretinoAppleJuice(); drink.OrderList = OrderList; drink.DataContext = aj; //drink.OrderList.DataContext = OrderList.DataContext; //test data context for order component drink.drink.Text = "Aretino Apple Juice"; drink.ice.Visibility = Visibility.Visible; }
/// <summary> /// Event handler for Candlehearth Coffee selection /// </summary> /// <param name="sender">control exectuting event</param> /// <param name="e">data for event</param> void CandlehearthCoffee(object sender, RoutedEventArgs e) { drink = new DrinkOptions(); containerBorder.Child = drink; CandlehearthCoffee cc = new CandlehearthCoffee(); drink.DataContext = cc; drink.OrderList = OrderList; drink.drink.Text = "Candlehearth Coffee"; drink.ice.Visibility = Visibility.Visible; drink.cream.Visibility = Visibility.Visible; drink.decaf.Visibility = Visibility.Visible; }
/// <summary> /// Event handler for sailor soda selection /// </summary> /// <param name="sender">control exectuting event</param> /// <param name="e">data for event</param> void SailorSoda(object sender, RoutedEventArgs e) { drink = new DrinkOptions(); containerBorder.Child = drink; SailorSoda ss = new SailorSoda(); drink.OrderList = OrderList; drink.DataContext = ss; drink.drink.Text = "Sailor Soda"; drink.ice.Visibility = Visibility.Visible; drink.sodaFlavors.Visibility = Visibility.Visible; }
/// <summary> /// Event handler for warrior water selection /// </summary> /// <param name="sender">control exectuting event</param> /// <param name="e">data for event</param> void WarriorWater(object sender, RoutedEventArgs e) { drink = new DrinkOptions(); containerBorder.Child = drink; WarriorWater ww = new WarriorWater(); drink.DataContext = ww; drink.drink.Text = "Warrior Water"; drink.OrderList = OrderList; drink.ice.Visibility = Visibility.Visible; drink.ice.IsChecked = true; drink.lemon.Visibility = Visibility.Visible; }