Exemple #1
0
        public ListingsOverviewViewModel(
            ListingFacade listingFacade
            )
        {
            BaseWindowTitle = "Přehled výčetek";
            _listingFacade  = listingFacade;
            Listings        = CollectionViewSource.GetDefaultView(listingFacade.FindListings(DateTime.Now.Year));

            _selectedYear = DateTime.Now.Year;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 private void LoadListings(int year)
 {
     Listings = CollectionViewSource.GetDefaultView(_listingFacade.FindListings(year));
 }