private void HoldPickleClicked(object sender, RoutedEventArgs args) { Trex?.HoldPickle(); if (this.combo != null) { if (this.combo.Entree is TRexKingBurger tb) { tb.HoldPickle(); } } }
public void HoldPickle(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.HoldPickle(); Combo.Entree = b; CollectionViewSource.GetDefaultView(order.Items).Refresh(); } } }