Exemplo n.º 1
0
 /// <summary>
 /// to add lemon oo the order item
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AddLemon_Click(object sender, RoutedEventArgs e)
 {
     if (tea)
     {
         if (DataContext is Order order)
         {
             if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is Drink drink)
             {
                 if (drink is Tyrannotea tea)
                 {
                     tea.AddLemon();
                 }
                 else if (drink is Water water)
                 {
                     water.AddLemon();
                 }
             }
         }
         tea = false;
     }
 }