Exemplo n.º 1
0
        /// <summary>
        /// This method is the click event for the sodasaurus button and adjusts buttons and bool values accordingly.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void SodasaurusClick(object sender, RoutedEventArgs args)
        {
            if (DataContext is Order order)
            {
                if (fromCombo)
                {
                    CustomizeCombo c = new CustomizeCombo();
                    c.CheckDrink();

                    if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo combo)
                    {
                        Sodasaurus t = new Sodasaurus();
                        t.Size      = combo.Size;
                        combo.Drink = t;
                    }
                }
                else
                {
                    order.Items.Add(new Sodasaurus());
                    CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
                }
            }

            addLemonButton.Visibility = Visibility.Collapsed;
            creamButton.Visibility    = Visibility.Collapsed;
            decafButton.Visibility    = Visibility.Collapsed;
            sweetButton.Visibility    = Visibility.Collapsed;
            flavorButton.Visibility   = Visibility.Visible;
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method is the click event for the water button and adjusts buttons and bool values accordingly.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void WaterClick(object sender, RoutedEventArgs args)
        {
            if (DataContext is Order order)
            {
                order.Items.Add(new Water());
                CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();

                if (fromCombo)
                {
                    CustomizeCombo c = new CustomizeCombo();
                    c.CheckDrink();

                    if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo combo)
                    {
                        Water t = new Water();
                        t.Size      = combo.Size;
                        combo.Drink = t;
                    }
                }
                else
                {
                    order.Items.Add(new Water());
                    CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
                }
            }

            addLemonButton.Visibility = Visibility.Visible;
            creamButton.Visibility    = Visibility.Collapsed;
            decafButton.Visibility    = Visibility.Collapsed;
            sweetButton.Visibility    = Visibility.Collapsed;
            flavorButton.Visibility   = Visibility.Collapsed;

            /*if (fromCombo)
             * {
             *  CustomizeCombo c = new CustomizeCombo();
             *  c.choseTea = false;
             *  c.choseWater = true;
             *  c.choseSoda = false;
             *  c.choseCoffee = false;
             *  c.CheckDrink();
             *  NavigationService.Navigate(c);
             * }*/
        }