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); }
public void DislpayMyAudioTab() { var songsCollection = new ObservableCollection <Song>(User.GetSongs()); var sTab = new SongTab(songsCollection, "Songs"); _tabsCollection.Add(sTab); MyTabControl.SelectedItem = sTab; }
private void GetPlaylistButton_OnClick(object sender, RoutedEventArgs e) { var album = (AlbumVk)AlbumsVkComboBox.SelectedItem; if (album == null) { return; } var sTab = new SongTab(new ObservableCollection <Song>(User.GetSongs(album.OwnerId, album.AlbumId)), album.Title); _tabsCollection.Add(sTab); MyTabControl.SelectedItem = sTab; }
public SongTab AddNewTab() { var renameWindow = new Rename("New Tab"); renameWindow.ShowDialog(); if (!renameWindow.IsConfurmed) { return(null); } SongTab sTab = new SongTab(new ObservableCollection <Song>(), renameWindow.Title); _tabsCollection.Add(sTab); return(sTab); }
private void SearchButton_OnClick(object sender, RoutedEventArgs e) { var cs = new SearchWindow(User.AccessToken); cs.ShowDialog(); if (cs.Result == null) { return; } var sTab = new SongTab(new ObservableCollection <Song>(User.GetSongList(cs.Result)), cs.SearchTextB.Text); _tabsCollection.Add(sTab); MyTabControl.SelectedItem = sTab; }