예제 #1
0
 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);
     }
 }
예제 #2
0
 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;
 }
예제 #3
0
        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) { }
                }
            }
        }
예제 #4
0
        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;
        }
예제 #5
0
 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) { }
 }
예제 #6
0
        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) { }

        }
예제 #7
0
 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) { }
         }
     }
 }
예제 #8
0
 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);
 }