Ejemplo n.º 1
0
        //public ObservableCollection<RaceViewModel> RaceViewModels { get; private set; }


        public RaceListViewModel(RaceRepository raceRepository)
        {
            if (raceRepository == null)
            {
                throw new ArgumentNullException("raceRepository");
            }
            _raceRepository = raceRepository;
            this.AllRaces = new ObservableCollection<Model.Race>(_raceRepository.GetRaces());

        }
Ejemplo n.º 2
0
        public IndexViewModel()
        {
            _raceRepository = new RaceRepository();
            _characterRepository = new CharacterRepository();

            //create an instance of our viewmodel that we want to display and add it to our collection
            RaceListViewModel viewModel = new RaceListViewModel(_raceRepository);
            //CharacterViewModel cViewModel = new CharacterViewModel(_characterRepository);

            this.ViewModels.Add(viewModel);
            //this.CViewModels.Add(cViewModel);

        }