Exemplo n.º 1
0
 /// <summary>Constructor</summary>
 /// <param name="client">Spotify Sdk Client</param>
 /// <param name="playItem">Spotify Track or Episode</param>
 public AddPlaylistItemDialogViewModel(ISpotifySdkClient client,
                                       IPlayItemResponse playItem) :
     base(client)
 {
     PlayItem  = playItem;
     Playlists = new ListPlaylistViewModel(client, PlaylistType.CurrentUserAddable);
     // Commands
     PrimaryCommand = new GenericCommand <IPlayItemResponse>(AddPlaylistItem);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Add Playlist Item
        /// </summary>
        /// <param name="response">Track or Episode</param>
        private async void AddPlaylistItem(IPlayItemResponse response)
        {
            var dialog = new AddPlaylistItemDialog(response);
            var result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary &&
                dialog.AddPlaylistItem.Result.IsSuccess)
            {
                NavigatePage(dialog.AddPlaylistItem.Playlist);
            }
        }
 /// <summary>
 /// Add User Playback Queue Handler
 /// </summary>
 /// <param name="client">Spotify Sdk Client</param>
 /// <param name="response">Play Item Response</param>
 public static async void AddUserPlaybackQueueHandler(
     this ISpotifySdkClient client,
     IPlayItemResponse response) =>
 await client.AddUserPlaybackQueueAsync(
     response.PlayItemType,
     response.Id);
Exemplo n.º 4
0
 /// <summary>
 /// Add Playlist Item
 /// </summary>
 /// <param name="playItem">Track or Episode</param>
 private async void AddPlaylistItem(IPlayItemResponse playItem) =>
 Result = await Client.AddPlaylistItemAsync(Playlist.Id, playItem.PlayItemType, playItem.Id);
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="playItemResponse">Playlist Response</param>
 public AddPlaylistItemDialog(IPlayItemResponse playItemResponse) : this() =>