/// <summary> /// Filters which control was pressed and changes the holding state of the respective item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { TexasTea tt = (TexasTea)DataContext; switch (((RadioButton)sender).Name) { case "SmallButton": order.subtotalFunc(tt, Size.Small); SmallButton.IsChecked = true; break; case "MediumButton": order.subtotalFunc(tt, Size.Medium); MediumButton.IsChecked = true; break; case "LargeButton": order.subtotalFunc(tt, Size.Large); LargeButton.IsChecked = true; break; default: throw new NotImplementedException("Unknown Texas Tea Toggle Button Pressed"); } order.InvokePropertyChanged(); }
/// <summary> /// Filters which control was pressed and changes the holding state of the respective item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { CowboyCoffee cc = (CowboyCoffee)DataContext; switch (((RadioButton)sender).Name) { case "SmallButton": order.subtotalFunc(cc, Size.Small); break; case "MediumButton": order.subtotalFunc(cc, Size.Medium); break; case "LargeButton": order.subtotalFunc(cc, Size.Large); break; default: throw new NotImplementedException("Unknown Cowboy Coffee Toggle Button Pressed"); } order.InvokePropertyChanged(); }
/// <summary> /// Filters which control was pressed and changes the holding state of the respective item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { Side s; Size size; if (DataContext is ChiliCheeseFries) { s = (ChiliCheeseFries)DataContext; } else if (DataContext is CornDodgers) { s = (CornDodgers)DataContext; } else if (DataContext is PanDeCampo) { s = (PanDeCampo)DataContext; } else { s = (BakedBeans)DataContext; } switch (((RadioButton)sender).Name) { //Size Cases case "SmallButton": size = Size.Small; SmallButton.IsChecked = true; break; case "MediumButton": size = Size.Medium; MediumButton.IsChecked = true; break; case "LargeButton": size = Size.Large; LargeButton.IsChecked = true; break; default: throw new NotImplementedException("Unknown Size Button Pressed"); } order.subtotalFunc(s, size); order.InvokePropertyChanged(); }
/// <summary> /// Filters which control was pressed and changes the holding state of the respective item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { JerkedSoda js = (JerkedSoda)DataContext; if (sender is Button) { //Flavor Cases switch (((Button)sender).Name) { case "OrangeSodaButton": js.Flavor = Flavor.OrangeSoda; break; case "CreamSodaButton": js.Flavor = Flavor.CreamSoda; break; case "SarsparillaButton": js.Flavor = Flavor.Sarsparilla; break; case "BirchBeerButton": js.Flavor = Flavor.BirchBeer; break; case "RootBeerButton": js.Flavor = Flavor.RootBeer; break; default: throw new NotImplementedException("Unknown Jerked Soda Toggle Button Pressed"); } } if (sender is RadioButton) { //Size Cases switch (((RadioButton)sender).Name) { case "SmallButton": order.subtotalFunc(js, Size.Small); SmallButton.IsChecked = true; break; case "MediumButton": order.subtotalFunc(js, Size.Medium); MediumButton.IsChecked = true; break; case "LargeButton": order.subtotalFunc(js, Size.Large); LargeButton.IsChecked = true; break; default: throw new NotImplementedException("Unknown Jerked Soda Toggle Button Pressed"); } } order.InvokePropertyChanged(); }