private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) { AlbumSelectionWindow albumSelection = new AlbumSelectionWindow(); albumSelection.ShowDialog(); if (albumSelection.Result == null) { return; } var album = albumSelection.Result; var albumSongs = new List <Song>(); foreach (var song in album.Songs) { var audioSearch = new AudioSearch(album.ArtistName + " – " + song, false, false, false, SortingOptions.Popularity, false, "0", "20", User.AccessToken); var s = User.GetSongList(audioSearch.Search()); if (s.Capacity == 0) { break; } albumSongs.Add(s[0]); await Task.Delay(300); } SongTab sTab = new SongTab(new ObservableCollection <Song>(albumSongs), album.AlbumName); _tabsCollection.Add(sTab); }
private void OkButton_OnClick(object sender, RoutedEventArgs e) { var audioSearch = new AudioSearch(SearchTextB.Text, CorrectErrorsCheckB.IsChecked.Value, HasLyricsCheckB.IsChecked.Value, PerformerOnlyCheckB.IsChecked.Value, (SortingOptions)SortingComboB.SelectionBoxItem, SearchInOwnComboB.IsChecked.Value, OffsetTextB.Text, CountTextB.Text, _accessToken); Result = audioSearch.Search(); Close(); }