Exemplo n.º 1
0
 public HistoryViewModel(PetRepository repository, IEventAggregator events)
 {
     _repository = repository;
     _history = repository.History;
     events.GetEvent<NewPetEvent>().Subscribe(pet => PetsChanged());
     events.GetEvent<SoldPetEvent>().Subscribe(pet => PetsChanged());
 }
Exemplo n.º 2
0
 public BasketModule(IRegionManager regionManager, IEventAggregator events, PetRepository petRepository, AccessoryRepository accessoryRepository, Messenger messenger)
 {
     _regionManager = regionManager;
     _events = events;
     _petRepository = petRepository;
     _accessoryRepository = accessoryRepository;
     _messenger = messenger;
 }
Exemplo n.º 3
0
 protected override DependencyObject CreateShell()
 {
     var events = Container.Resolve<IEventAggregator>();
     var history = new Domain.History();
     var petRepository = new PetRepository(history, events);
     var accessoryRepository = new AccessoryRepository();
     Container.RegisterInstance(history);
     Container.RegisterInstance(petRepository);
     Container.RegisterInstance(accessoryRepository);
     Container.RegisterInstance(new Messenger());
     Container.RegisterType(typeof(ShellViewModel));
     var shell = Container.Resolve<Shell>();
     shell.Show();
     return shell;
 }
Exemplo n.º 4
0
 public PetRegistryModule(IRegionManager regionManager, IEventAggregator events, PetRepository petRepository)
 {
     _regionManager = regionManager;
     _events = events;
     _petRepository = petRepository;
 }