public ReportsFilterModule() { BusinessUnits = StaticCollections.BusinessUnits; LoadCountries(); ProjectTypes = StaticCollections.ProjectTypes; LoadCountriesList(); AllCountriesCommand = new RelayCommand(SelectCountries, param => this.canExecute); ExpandCountriesCommand = new RelayCommand(ShowCountries, param => this.canExecute); //initialise filter CountriesSrchString = string.Join(",", CountriesFilter.Where(t => t.IsSelected == true).Select(x => x.ID).ToList()); }
private void FlCountries_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "IsSelected") { string temp = string.Join(",", CountriesFilter.Where(t => t.IsSelected == true).Select(x => x.ID).ToList()); if (!string.IsNullOrEmpty(temp)) { CountriesSrchString = temp; } else { CountriesSrchString = string.Empty; } } }
private void LoadCountriesList() { Collection <int> t = GetUserCountryAccess(); FilterListItem fi; foreach (CountryModel ag in Countries) { if (t.Contains(ag.ID)) { fi = new FilterListItem { ID = ag.ID, Name = ag.Name, IsSelected = allcountries, VisibleState = Visibility.Visible }; fi.PropertyChanged += FlCountries_PropertyChanged; CountriesFilter.Add(fi); } } }