Example #1
0
        public ShopVM(NinjaListVM ninjaListVM, InventoryListVM inventoryListVM)
        {
            this._ninjaListVM = ninjaListVM;

            this.NinjaVM = _ninjaListVM.SelectedNinja;

            this._inventoryListVM = inventoryListVM;



            using (var context = new NinjaEntities())
            {
                var equipment = context.Equipments.ToList();
                ShopItemsOC = new ObservableCollection <EquipmentVM>(equipment.Select(e => new EquipmentVM(e)));
            }



            ShowInventoryCommand = new RelayCommand(ShowInventory);
            BuyItemCommand       = new RelayCommand(BuyItem);



            ShowLegsCategoryCommand      = new RelayCommand(RetrieveLegsItems);
            ShowBeltCategoryCommand      = new RelayCommand(RetrieveBeltItems);
            ShowChestCategoryCommand     = new RelayCommand(RetrieveChestItems);
            ShowBootsCategoryCommand     = new RelayCommand(RetrieveBootsItems);
            ShowShouldersCategoryCommand = new RelayCommand(RetrieveShouldersItems);
        }
        public EquipmentListVM(InventoryListVM inventoryListVM)
        {
            _inventoryListVM = inventoryListVM;

            using (var context = new NinjaEntities())
            {
                var equipments = context.Equipments.ToList();
                EquipmentsOC = new ObservableCollection <EquipmentVM>(equipments.Select(r => new EquipmentVM(r)));
            }

            ShowAddEquipmentCommand    = new RelayCommand(ShowAddEquipment, CanShowAddEquipment);
            ShowUpdateEquipmentCommand = new RelayCommand(ShowUpdateEquipment, CanUpdateEquipment);
            DeleteEquipmentCommand     = new RelayCommand(DeleteEquipment);

            ShowIventoryCommand = new RelayCommand(ShowInventory);
        }
Example #3
0
 public NinjaGearVM(InventoryListVM inventoryListVM)
 {
     this._inventoryListVM = inventoryListVM;
 }