예제 #1
0
 /// <summary>Constructor</summary>
 /// <param name="client">Spotify Sdk Client</param>
 /// <param name="showId">Spotify Show Id</param>
 public ShowPageViewModel(ISpotifySdkClient client, string showId) :
     base(client, showId)
 {
     // Tracks
     Episodes = new ListEpisodeViewModel(client, EpisodeType.Show, showId);
     // Command Actions
     client.CommandActions.Episode = (item) => NavigatePage(item);
 }
예제 #2
0
        public async Task ListEpisodeViewModel_Show_Test(string id)
        {
            // Arrange
            var model = new ListEpisodeViewModel(_client, EpisodeType.Show, id);

            // Act
            await((ISupportIncrementalLoading)model.Collection).LoadMoreItemsAsync(count);
            // Assert
            Assert.IsTrue(model.Collection.Count > 0);
        }
예제 #3
0
        public async Task ListEpisodeViewModel_Multiple_Test(string id)
        {
            // Arrange
            var ids = new List <string> {
                id
            };
            var model = new ListEpisodeViewModel(_client, EpisodeType.Multiple, multipleEpisodeIds: ids);

            // Act
            await((ISupportIncrementalLoading)model.Collection).LoadMoreItemsAsync(count);
            // Assert
            Assert.IsTrue(model.Collection.Any(a => a.Id == id));
        }
예제 #4
0
        public async Task ListEpisodeViewModel_Favourite_Test(string id)
        {
            // Arrange
            _client.Favourites.EpisodeIds = new List <string> {
                id
            };
            var model = new ListEpisodeViewModel(_client, EpisodeType.Favourite);
            // Act
            var result = await((ISupportIncrementalLoading)model.Collection).LoadMoreItemsAsync(count);

            // Assert
            Assert.IsTrue(model.Collection.Any(a => a.Id == id));
        }
예제 #5
0
 /// <summary>Constructor</summary>
 /// <param name="client">Spotify Sdk Client</param>
 public FavouritesPageViewModel(ISpotifySdkClient client) : base(client)
 {
     // Albums
     Albums = new ListAlbumViewModel(client, AlbumType.Favourite);
     // Tracks
     Tracks = new ListTrackViewModel(client, TrackType.Favourite);
     // Artists
     Artists = new ListArtistViewModel(client, ArtistType.Favourite);
     // Shows
     Shows = new ListShowViewModel(client, ShowType.Favourite);
     // Episodes
     Episodes = new ListEpisodeViewModel(client, EpisodeType.Favourite);
     // Command Actions
     client.CommandActions.Album    = (item) => NavigatePage(item);
     client.CommandActions.Artist   = (item) => NavigatePage(item);
     client.CommandActions.Playlist = (item) => NavigatePage(item);
     client.CommandActions.Show     = (item) => NavigatePage(item);
     client.CommandActions.Episode  = (item) => NavigatePage(item);
 }
예제 #6
0
 /// <summary>Constructor</summary>
 /// <param name="client">Spotify Sdk Client</param>
 /// <param name="value">Search Term</param>
 public SearchPageViewModel(ISpotifySdkClient client, string value) : base(client)
 {
     // Albums
     Albums = new ListAlbumViewModel(client, AlbumType.Search, value);
     // Tracks
     Tracks = new ListTrackViewModel(client, TrackType.Search, value);
     // Artists
     Artists = new ListArtistViewModel(client, ArtistType.Search, value);
     // Playlists
     Playlists = new ListPlaylistViewModel(client, PlaylistType.Search, value);
     // Shows
     Shows = new ListShowViewModel(client, ShowType.Search, value);
     // Episodes
     Episodes = new ListEpisodeViewModel(client, EpisodeType.Search, value);
     // Command Actions
     client.CommandActions.Album    = (item) => NavigatePage(item);
     client.CommandActions.Artist   = (item) => NavigatePage(item);
     client.CommandActions.Track    = (item) => NavigatePage(item);
     client.CommandActions.Playlist = (item) => NavigatePage(item);
     client.CommandActions.Show     = (item) => NavigatePage(item);
     client.CommandActions.Episode  = (item) => NavigatePage(item);
 }