Esempio n. 1
0
        private void RedrawPendingItems()
        {
            PendingItemsComponent.Children.Clear();
            foreach (OrderedItem item in pendingItems)
            {
                PendingItemControl component = new PendingItemControl();
                component.ItemName.Text = item.itemDefinition.name;
                component.Price.Text    = item.isRefill ? "0.00" : (item.EffectiveCost() / 100.0).ToString("F");

                component.XButton.Click += (s, eArgs) =>
                {
                    if (initialized)
                    {
                        pendingItems.Remove(item);
                        RedrawPendingItems();
                    }
                };

                component.EditButton.Click += (s, args) =>
                {
                    Global.Main.Hide();
                    ItemProfile itemProfile = new ItemProfile(item);
                    itemProfile.EnterEditMode();
                    itemProfile.ShowDialog();
                    RedrawPendingItems();
                };
                PendingItemsComponent.Children.Add(component);
            }
            RecalculatePrice();
            UpdateAddToOrderButton();
        }
Esempio n. 2
0
        public void OnMenuItemSelected(object sender, RoutedEventArgs e)
        {
            OrderedItem menuItem = new OrderedItem(ItemDefinitionController.itemDefinitions[(sender as Button).Tag as string], "currentUserId");
            ItemProfile profile  = new ItemProfile(menuItem);

            Global.Main.Hide();
            profile.ShowDialog();
        }