private void HoldPeppersClicked(object sender, RoutedEventArgs args) { bronto?.HoldPeppers(); if (this.combo != null) { if (this.combo.Entree is Brontowurst wurst) { wurst.HoldPeppers(); } } }
public void HoldPeppers(object sender, RoutedEventArgs e) { if (DataContext is Order order) { if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is DinoDiner.Menu.CretaceousCombo Combo) { DinoDiner.Menu.Brontowurst b = (DinoDiner.Menu.Brontowurst)Combo.Entree; b.HoldPeppers(); Combo.Entree = b; CollectionViewSource.GetDefaultView(order.Items).Refresh(); } } }