public NinjaListVM()
        {
            using (var context = new LeagueOfNinjasEntities())
            {
                var ninjas = context.Ninjas.ToList();
                Ninjas = new ObservableCollection <NinjaVM>(ninjas.Select(n => new NinjaVM(n)));
            }

            ShowAddNinja       = new RelayCommand(ShowAddNinjaWindow);
            ShowEditNinja      = new GenericCommand(ShowEditNinjaWindow, CanExecute);
            DeleteNinjaCommand = new GenericCommand(Delete, CanExecute);
            SelectNinjaCommand = new GenericCommand(SelectNinja, CanExecute);
        }
Exemple #2
0
 public AddItemVM(ShopVM shopvm)
 {
     AddCommand = new GenericCommand(Add, CanAdd);
     _shopVM    = shopvm;
 }
Exemple #3
0
 public AddNinjaVM(NinjaListVM ninjas)
 {
     _ninjas    = ninjas;
     Ninja      = new NinjaVM();
     AddCommand = new GenericCommand(Add, CanAdd);
 }
        public InventoryVM(NinjaVM selectedNinja)
        {
            SelectedNinja = selectedNinja;

            ClearInventoryCommand = new GenericCommand(Clear, CanClear);
        }