private void lbxCategories_SelectedIndexChanged(object sender, EventArgs e) { dgPodcastFeed.Rows.Clear(); var selectedCategory = lbxCategories.SelectedItem?.ToString(); var podcastList = podcastController.GetPodcasts(); foreach (var podcast in podcastList.Where(p => p.Category.Equals(selectedCategory))) { dgPodcastFeed.Rows.Add(podcast.TotalEpisodes, podcast.Name, podcast.Interval, podcast.Category); } }
public MainWindow() { InitializeComponent(); podcastController = new PodcastController(); episodeController = new EpisodeController(); categoryController = new CategoryController(); podcasts = podcastController.GetPodcasts(); FillPodcastList(); FillCategoryList(); FillCategoryComboBox(); InitTimers(); }