public AllSongsViewModel() { GoBackCommand = new RelayCommand(GoBack); AddToQueueCommand = new RelayCommand(AddToQueue); PlayCommand = new RelayCommand(Play); SongHits = (List <Song>)NavigationService.GetInstance().Content; }
public ArtistViewModel() { CurrentArtist = (Artist)NavigationService.GetInstance().Content; ArtistName = CurrentArtist.ArtistName; ArtistArtRef = CurrentArtist.ArtistArtRef; ArtistSongs = CurrentArtist.TopTracks; ArtistTopFive = new List <Song>(); if (ArtistSongs != null) { for (int i = 0; i < 5 && i < ArtistSongs.Count; i++) { ArtistTopFive.Add(ArtistSongs[i]); } } GoBackCommand = new RelayCommand(GoBack); PlayOverrideQueueCommand = new RelayCommand(PlayOverrideQueue); AddToQueueCommand = new RelayCommand(AddToQueue); ArtistAlbums = CurrentArtist.ArtistAlbums; TopFiveAlbums = new List <Album>(); if (ArtistAlbums != null) { for (int i = 0; i < 5 && i < ArtistAlbums.Count; i++) { TopFiveAlbums.Add(ArtistAlbums[i]); } } }
public AlbumViewModel() { CurrentAlbum = (Album)NavigationService.GetInstance().Content; SongList = CurrentAlbum.AlbumTracks; AlbumTitle = CurrentAlbum.AlbumName; AlbumArtist = CurrentAlbum.AlbumArtist; AlbumArtRef = CurrentAlbum.AlbumArtRef; GoBackCommand = new RelayCommand(GoBack); PlayOverrideQueueCommand = new RelayCommand(PlayOverrideQueue); AddToQueueCommand = new RelayCommand(AddToQueue); }
public async void NavigateToAlbum(object parameter) { Album currentAlbum = (Album)parameter; HttpRequestMessage message = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://mclients.googleapis.com/sj/v1.11/fetchalbum?alt=json&nid=" + currentAlbum.Id + "&include-tracks=true", UriKind.Absolute) }; HttpResponseMessage returnString = await HttpCall.MakeGetCallAsync(message); var str = await returnString.Content.ReadAsStringAsync(); currentAlbum = JsonParser.ParseAlbum(str); NavigationService.GetInstance().Navigate(typeof(AlbumPage), currentAlbum); }
public async void PerformLogin(object parameter) { Auth auth = Auth.getInstance(); bool loginSuccessful = await auth.Login(Username, Password); if (loginSuccessful) { NavigationService.GetInstance().Navigate(typeof(MainMenu), auth.authToken); } else { ShowErrorMessage = "Visible"; OnPropertyChanged("ShowErrorMessage"); } }
public async void NavigateToArtist(object parameter) { Artist currentArtist = (Artist)parameter; HttpRequestMessage message = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://mclients.googleapis.com/sj/v1.11/fetchartist?alt=json&nid=" + currentArtist.ArtistId + "&include-albums=true&num-top-tracks=50&num-related-artists=5", UriKind.Absolute) }; HttpResponseMessage returnString = await HttpCall.MakeGetCallAsync(message); var str = await returnString.Content.ReadAsStringAsync(); currentArtist = JsonParser.ParseArtist(str); NavigationService.GetInstance().Navigate(typeof(ArtistPage), currentArtist); }
public void NavigateToAllArtists(object parameter) { NavigationService.GetInstance().Navigate(typeof(AllArtistsPage), Hits.GetArtistHits(AllHits.entries, 50)); }
public void GoBack(object parameter) { NavigationService.GetInstance().GoBack(); }
public AllArtistsViewModel() { ArtistHits = (List <Artist>)NavigationService.GetInstance().Content; GoBackCommand = new RelayCommand(GoBack); NavigateToArtistCommand = new RelayCommand(NavigateToArtist); }