コード例 #1
0
        public void Add(OrderItem orderItem)
        {
            OrderItemCell orderItemCell = new OrderItemCell(orderItem, this);

            orderItemCell.OnAction += this.OrderItemCell_OnAction;
            this.pendingItemStackPanel.Children.Add(orderItemCell);

            this.Update();

            this.scrollViewer.ScrollToEnd();
        }
コード例 #2
0
        private void FinalizeOrder()
        {
            foreach (OrderItemCell orderItemCell in this.pendingItemStackPanel.Children)
            {
                OrderItemCell orderItemCellCopy = new OrderItemCell(orderItemCell.orderItem, this);
                orderItemCellCopy.OnAction += this.OrderItemCell_OnAction;

                this.finalizedItemStackPanel.Children.Add(orderItemCellCopy);
                orderItemCellCopy.orderItem.isFinalized = true;
                orderItemCellCopy.update();
                //orderItemCell.IsEnabled = !orderItemCell.orderItem.isFinalized;
            }
            this.pendingItemStackPanel.Children.Clear();


            this.Update();
        }
コード例 #3
0
        private void OrderItemCell_OnAction(OrderItemCell sender, OrderItemCell.ActionType action)
        {
            switch (action)
            {
            case OrderItemCell.ActionType.Edit:
                MessageBox.Show("TODO: Bring up options menu again");
                break;

            case OrderItemCell.ActionType.Delete:
                if (!sender.orderItem.isFinalized)
                {
                    this.Remove(sender);
                }
                break;

            case OrderItemCell.ActionType.RequestServer:
                MessageBox.Show("Server is on the way!");
                break;
            }
        }
コード例 #4
0
        public void Remove(OrderItemCell orderItemCell)
        {
            this.pendingItemStackPanel.Children.Remove(orderItemCell);

            this.Update();
        }