示例#1
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (genreSelector.SelectedValue == null)
            {
                return;
            }
            Genre SelectedGenre            = (Genre)genreSelector.SelectedValue;
            IList <AlbumSummary> listalbum = AlbumSummaryService.GetAlbumSummariesByGenres(SelectedGenre.GenreId);

            oefening1grid.ItemsSource = listalbum;
        }
        private void GenreComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (GenreComboBox.SelectedIndex == -1)
            {
                return;
            }

            Genre selectedGenre = (Genre)GenreComboBox.SelectedItem;

            albumDataGrid.ItemsSource = AlbumSummaryService.GetAlbumSummariesByGenre(selectedGenre.ID);
        }
        private void genreComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Genre genre = genreComboBox.SelectedItem as Genre;

            IList <AlbumSummary> sum = new List <AlbumSummary>();

            sum = AlbumSummaryService.GetAlbumSummariesByGenre(genre.GenreId);
            albumDataGrid.Items.Clear();

            foreach (AlbumSummary albumSummary in sum)
            {
                albumDataGrid.Items.Add(albumSummary);
            }
        }
示例#4
0
        private void genreComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            albumDataGrid.DataContext = null;
            int index = 0;
            List <AlbumSummary> albumsInAanmerking = new List <AlbumSummary>();

            for (int i = 0; i < alleGenresGlobaal.Count; i++)
            {
                if ((int)genreComboBox.SelectedValue - 1 == i)
                {
                    index = i;
                    i     = alleGenresGlobaal.Count;
                }
            }

            albumsInAanmerking = AlbumSummaryService.GetAlbumSummariesByGenre(alleGenresGlobaal[index]);

            albumDataGrid.DataContext = albumsInAanmerking;
        }