public void OnClick(View itemView, int position, bool isLongClick) { if (this.blockID != "" && this.blockID != "false") { AudioInBlock data = new AudioInBlock(tracks[position], this.blockID); ItemInBlockClick?.Invoke(itemView, data); } else { ItemClick?.Invoke(itemView, tracks[position]); } }
private void AdapterOnItemClick(object sender, AudioInBlock args) { Toast.MakeText(Application.Context, $"{args.track.Title} в блоке {args.blockID}", ToastLength.Long).Show(); var tracks = this.Blocks.First(b => b.Title == args.blockID).Tracks; var tracksfiles = MusicService.ConvertToAudioFile(tracks); var playlist = new PlaylistFile(); playlist.Artist = "Music X"; playlist.Cover = "playlist_placeholder"; playlist.Genre = ""; playlist.Id = 1000; playlist.IsAlbum = false; playlist.TracksFiles = tracksfiles; var player = PlayerService.Instanse; player.Play(playlist, playlist.TracksFiles.First(t => t.SourceString == args.track.SourceString)); }