Example #1
0
        private void Flavor_Click(object sender, RoutedEventArgs e)
        {
            FlavorSelection FlavorSel = new FlavorSelection();

            FlavorSel.selection = this;
            NavigationService.Navigate(FlavorSel);
            if (isPartOfCombo)
            {
                NotifyOfPropertyChange("Special");
            }
        }
        /// <summary>
        /// Navigates to the flavor selection page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void SelectFlavor(object sender, RoutedEventArgs args)
        {
            FlavorSelection fs = new FlavorSelection();

            fs.SelectionPage = this;
            NavigationService.Navigate(fs);
            if (isCombo)
            {
                NotifyOfPropertyChange("Special");
            }
        }
        /// <summary>
        /// Click handler for the flavor button
        /// </summary>
        /// <param name="sender">The object that sent the event</param>
        /// <param name="e">The arguements of the event</param>
        private void FlavorClick(object sender, RoutedEventArgs e)
        {
            FlavorSelection flvr;

            if (cmbo != null)
            {
                flvr = new FlavorSelection(cmbo);
            }
            else
            {
                flvr = new FlavorSelection(edit, index);
            }
            flvr.DataContext = DataContext;
            NavigationService.Navigate(flvr);
        }
Example #4
0
        /// <summary>
        /// Handles what happens when the special data button is clicked.
        /// </summary>
        /// <param name="sender">The object being clicked.</param>
        /// <param name="e">The RoutedEventArgs.</param>
        private void SpecialClick(object sender, RoutedEventArgs e)
        {
            switch (CurDrink)
            {
            case Drinks.Sodasaurus:
                FlavorSelection flavorPage = new FlavorSelection();
                flavorPage.returnPage = this;
                NavigationService.Navigate(flavorPage);
                break;

            case Drinks.Tyrannotea:
                if (!SpecialValue)
                {
                    uxExtraData.Content    = "Make Unsweet";
                    SpecialValue           = true;
                    uxExtraData.Background = Brushes.LightBlue;
                }
                else
                {
                    uxExtraData.Content    = "Make Sweet";
                    SpecialValue           = false;
                    uxExtraData.Background = Brushes.White;
                }

                if (editedDrink == null)
                {
                    if (DataContext is Order order1)
                    {
                        if (CollectionViewSource.GetDefaultView(order1.Items).CurrentItem is Tyrannotea tea)
                        {
                            tea.Sweet = SpecialValue;
                        }
                    }
                }
                else
                {
                    if (editedDrink is Tyrannotea tea)
                    {
                        tea.Sweet = SpecialValue;
                        UpdateCurrentItem();
                    }
                }
                break;

            case Drinks.JurassicJava:
                if (!SpecialValue)
                {
                    uxExtraData.Content    = "Make Caffeinated";
                    SpecialValue           = true;
                    uxExtraData.Background = Brushes.LightBlue;
                }
                else
                {
                    uxExtraData.Content    = "Make Decaf";
                    SpecialValue           = false;
                    uxExtraData.Background = Brushes.White;
                }

                if (editedDrink == null)
                {
                    if (DataContext is Order order2)
                    {
                        if (CollectionViewSource.GetDefaultView(order2.Items).CurrentItem is JurassicJava java)
                        {
                            java.Decaf = SpecialValue;
                        }
                    }
                }
                else
                {
                    if (editedDrink is JurassicJava java)
                    {
                        java.Decaf = SpecialValue;
                        UpdateCurrentItem();
                    }
                }
                break;
            }
        }
Example #5
0
        /// <summary>
        /// Navigates to the desired window
        /// </summary>
        /// <param name="sender"> sends where it was clicked</param>
        /// <param name="e">and the event argument</param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            FlavorSelection fl = new FlavorSelection();

            NavigationService.Navigate(fl);
        }