private async void DeleteItemInListHandler()
        {
            CurrentInventoryItem.Amount = 0;
            await UpdateInventoryItemQuantity();

            InventoryItems.Clear();
            GetShoppingList();
        }
Exemplo n.º 2
0
 public void ClearInventory()
 {
     foreach (EquipmentVM e in InventoryItems)
     {
         //code die statistics verwijderd en geld vermeerderd van de verkochte items
     }
     InventoryItems.Clear();
 }
Exemplo n.º 3
0
 public void ClearInventory()
 {
     foreach (ItemVM item in InventoryItems)
     {
         Gold += item.Price;
     }
     InventoryItems.Clear();
     UpdateStats();
 }
        private async void ClearListHandler()
        {
            //Clear list in view

            InventoryItems.Clear();

            //Clear list in db

            try
            {
                await _backendConnection.DeleteShoppingList();
            }
            catch (ApiException e)
            {
                MessageBox.Show($"Fejl {e.StatusCode}", "Error!");
            }
            catch (HttpRequestException exception)
            {
                MessageBox.Show($"Der er ingen forbindele til serveren", "Error!");
            }
        }
Exemplo n.º 5
0
        public void ApplyEndGame(int levelNumber, int points,
                                 EndTypes endType, IList <InventoryItem> items, Location location)
        {
            var gameEndRecord = new GameEndRecord
            {
                LevelNumber = levelNumber,
                Points      = points,
                EndType     = endType
            };

            GameEndRecords.Add(gameEndRecord);
            InventoryItems.Clear();
            if (endType != EndTypes.Died)
            {
                Location = location;
                if (items.Any())
                {
                    InventoryItems.AddRange(items);
                }
            }
        }
 private void UpdateShoppingList()
 {
     InventoryItems.Clear();
     GetShoppingList();
 }