public ListingsOverviewViewModel( ListingFacade listingFacade ) { BaseWindowTitle = "Přehled výčetek"; _listingFacade = listingFacade; Listings = CollectionViewSource.GetDefaultView(listingFacade.FindListings(DateTime.Now.Year)); _selectedYear = DateTime.Now.Year; }
private void LoadListings(int year, int month) { CanGenerate = false; var listings = _listingFacade.FindListings(year, month); _listingsList = new List <ListingCheckBoxWrapper>(); foreach (Listing l in listings) { ListingCheckBoxWrapper w = new ListingCheckBoxWrapper(l); w.OnIsCheckedChanged += (s, v) => { IEnumerable <Listing> result = from ListingCheckBoxWrapper lw in _listingsList where lw.IsChecked == true select lw.Listing; CanGenerate = result.Count() > 0; }; _listingsList.Add(w); } Listings = CollectionViewSource.GetDefaultView(_listingsList); }
private void LoadListings(int year) { Listings = CollectionViewSource.GetDefaultView(_listingFacade.FindListings(year)); }