public HistoryViewModel(PetRepository repository) { _repository = repository; _history = repository.History; _history.PropertyChanged += delegate { PropertyChanged(this, new PropertyChangedEventArgs("HistorySoFar")); }; }
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)) { }