public async Task LoadMore() { List<Track> trackList = await NhacCuaTui.GetTrackByGenreAsync(link, 0); foreach (var track in trackList) { TrackViewModel tvm = new TrackViewModel(track); TrackList.Add(tvm); } }
public async Task LoadInit(string link) { if (link == null) link = this.link; else this.link = link; List<Track> trackList = await NhacCuaTui.GetTrackByGenreAsync(link, 0); TrackList.Clear(); foreach(var track in trackList) { TrackViewModel tvm = new TrackViewModel(track); TrackList.Add(tvm); } IsDataLoaded = true; }
public async Task LoadTrackList() { if (!IsDataLoaded) { await album.LoadTrackListAsync(); foreach (var track in album.TrackList) { try { TrackViewModel trackVM = new TrackViewModel(); trackVM = new TrackViewModel(track); TrackList.Add(trackVM); } catch (Exception) { } } } }
public async Task LoadInit(string link) { if (link == null) { link = this.link; } else { this.link = link; } List <Track> trackList = await NhacCuaTui.GetTrackByGenreAsync(link, 0); TrackList.Clear(); foreach (var track in trackList) { TrackViewModel tvm = new TrackViewModel(track); TrackList.Add(tvm); } IsDataLoaded = true; }
public AlbumViewModel(Album album) { try { title = album.Title; this.album = album; artist = album.Artist; if (album.Cover != null) { Cover = new BitmapImage(new Uri(album.Cover, UriKind.Absolute)); } TrackList = new ObservableCollection <TrackViewModel>(); foreach (var track in album.TrackList) { try { TrackViewModel trackVM = new TrackViewModel(track); TrackList.Add(trackVM); } catch (Exception) { } } } catch (Exception) { } }
public AlbumViewModel(Album album) { try { title = album.Title; this.album = album; artist = album.Artist; if (album.Cover != null) Cover = new BitmapImage(new Uri(album.Cover, UriKind.Absolute)); TrackList = new ObservableCollection<TrackViewModel>(); foreach (var track in album.TrackList) { try { TrackViewModel trackVM = new TrackViewModel(track); TrackList.Add(trackVM); } catch (Exception) { } } } catch (Exception) { } }
public void Coppy(TrackViewModel trackvm) { Title = trackvm.Title; Cover = trackvm.Cover; Song = trackvm.Song; Artist = trackvm.Artist; Location = trackvm.Location; App.GlobalMediaElement.Source = new Uri(App.TrackVM.Location, UriKind.Absolute); }