示例#1
0
        public NinjaVisualViewModel(Entities database)
        {
            _database = database;
            _ninja    = MainViewModel.CurrentNinja;

            Loadouts        = _database.Loadouts.Where(e => e.Ninja == _ninja.Id).ToList();
            SelectedLoadout = Loadouts.First();

            _noItem      = new Data.Equipment();
            _noItem.Name = "No Item Found";
        }
示例#2
0
        public EquipmentCreateViewModel(EquipmentListViewModel viewModel, Entities database)
        {
            _database  = database;
            _viewModel = viewModel;

            Equipment      = new Data.Equipment();
            EquipmentTypes = database.Categories.ToList();

            SaveCommand        = new RelayCommand(Save);
            CancelCommand      = new RelayCommand(Cancel);
            SelectImageCommand = new RelayCommand(SelectImage);

            Equipment.Name     = "New Item";
            Equipment.Category = EquipmentTypes.First();
            Equipment.Value    = 1;
        }