public UpdateHomes(PeopleCollection people, HomeCollection homes, HomeSalesCollection homeSales, RealEstateCompanyCollection realEstateCompanies) { InitializeComponent(); peopleUd = people; HomeUd = homes; homeSalesCollection = homeSales; IsVisibleChanged += UpdateHomes_IsVisibleChanged; Closing += UpdateHomes_Closing; }
private void Button_Click_3(object sender, RoutedEventArgs e)//refresh db { using (HomeTrackerModel1 db = new HomeTrackerModel1()) { //retrieve data: homeCollection = new HomeCollection(db.Homes.ToList()); homeSalesCollection = new HomeSalesCollection(db.HomeSales.ToList()); peopleCollection = new PeopleCollection(db.People.ToList()); realEstateCompaniesCollection = new RealEstateCompanyCollection(db.RealEstateCompanies.ToList()); } HomeDataGrid.DataContext = homeCollection; }
public MainWindow() { homeCollection = new HomeCollection(); homeSalesCollection = new HomeSalesCollection(); peopleCollection = new PeopleCollection(); realEstateCompaniesCollection = new RealEstateCompanyCollection(); InitializeComponent(); DataContext = this; using (HomeTrackerModel1 db = new HomeTrackerModel1()) { //retrieve data: homeCollection = new HomeCollection(db.Homes.ToList()); homeSalesCollection = new HomeSalesCollection(db.HomeSales.ToList()); peopleCollection = new PeopleCollection(db.People.ToList()); realEstateCompaniesCollection = new RealEstateCompanyCollection(db.RealEstateCompanies.ToList()); addHomeWindow = new AddHome(peopleCollection, homeCollection); updateHomesWindow = new UpdateHomes(peopleCollection, homeCollection, homeSalesCollection, realEstateCompaniesCollection); removeAHomeWindow = new removeAHome(peopleCollection, homeCollection); } }