public async override void Execute(object parameter) { Locator.NavigationService.Go(VLCPage.MusicPlayerPage); Locator.MusicLibraryVM.IsAlbumPageShown = false; TrackItem track = null; if (parameter is ItemClickEventArgs) { var args = parameter as ItemClickEventArgs; track = args.ClickedItem as TrackItem; } else if (parameter is TrackItem) { track = parameter as TrackItem; } if (track == null) { // if the track is still null (for some reason), we need to break early. return; } await PlaylistHelper.AddTrackToPlaylist(track, false); }