private void HoldTomatoClicked(object sender, RoutedEventArgs args) { Trex?.HoldTomato(); if (this.combo != null) { if (this.combo.Entree is TRexKingBurger tb) { tb.HoldTomato(); } } }
public void HoldTomato(object sender, RoutedEventArgs e) { if (DataContext is Order order) { if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is DinoDiner.Menu.CretaceousCombo Combo) { DinoDiner.Menu.TRexKingBurger b = (DinoDiner.Menu.TRexKingBurger)Combo.Entree; b.HoldTomato(); Combo.Entree = b; CollectionViewSource.GetDefaultView(order.Items).Refresh(); } } }