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 PetRepository(History history) { _history = history; _pets = new List<Pet> { new Pet { Name = "Spot", Type = PetType.ALL[2], FoodType = PetFood.ALL[1], Price = "100.00" }, new Pet { Name="Cinnamon", Type = PetType.ALL[1], FoodType = PetFood.ALL[0], Price = "4.50" }, }; }