private bool SearchForSong(string titleToSearchFor)
 {
     var song = SongAccess.DoesSongExist(titleToSearchFor);
     if (song[0] == null) return false;
     var playlist = new ListViewService();
     songOrCdDataGrid.ItemsSource = playlist.CreateViewItem(song);
     return true;
 }
        private void GetPlayListWithSeconds(int seconds)
        {
            ListViewService playlist = new ListViewService();
            playListDataGrid.ItemsSource = string.Empty;

            var play = PlayList.GetRandomSongList(seconds);
            List<AlbumSongView> playListView = play.Select(song => playlist.CreateViewItem(song)).ToList();
            playListDataGrid.ItemsSource = playListView;
        }
        private void searchButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var selectedItem = findByGenreComboBox.Text;
                if (selectedItem != null)
                {
                    ListViewService listView = new ListViewService();
                    List<Song> songListByGenre = SongAccess.GenreService.GetSongListByGenre(selectedItem);
                    List<AlbumSongView> genreListView = songListByGenre.Select(song => listView.CreateViewItem(song)).ToList();

                    findSongsByGenreDataGrid.ItemsSource = genreListView;
                    findAlbumsByGenreDataGrid.ItemsSource = SongAccess.GenreService.GetAlbumListByGenre(selectedItem);
                }
            }
            catch (NullReferenceException ex)
            {
                DisplayExceptions.DisplayNullReference(ex);
            }
            catch (Exception ex)
            {
                DisplayExceptions.DisplayException(ex);
            }
        }