コード例 #1
0
 public HistoryViewModel(PetRepository repository)
 {
     _repository = repository;
     _history = repository.History;
     _history.PropertyChanged +=
         delegate { PropertyChanged(this, new PropertyChangedEventArgs("HistorySoFar")); };
 }    
コード例 #2
0
 protected override DependencyObject CreateShell()
 {
     var history = new History();
     var petRepository = new PetRepository(history);
     Container.RegisterInstance(history);
     Container.RegisterInstance(petRepository);
     var shell = Container.Resolve<Shell>();
     shell.Show();
     return shell;
 }
 public RegistrationViewModel(PetRepository petRepository)
 {
     _petRepository = petRepository;
     _pet = new Pet();
 }
 public SavePetCommand(PetRepository repository, Pet pet)
     : base(o => repository.Save(pet))
 {
 }