我正在使用wpToolkit的LongListMultiSelector。
我想从不同的专辑中选择不同的歌曲。
我想向用户显示,“歌曲1”、“歌曲2”是在尝试选择一个之前被选中的。但是,如果用户返回同一张专辑,我无法标记之前选定的歌曲。
有没有办法这么做。
发布于 2016-01-17 09:04:09
使用专辑歌曲检查选定的SongList。然后添加到这样的lls中。
llms.ItemsSource = this.mediaCollection;
int i = 0;
foreach (StorageFile file in SongList) //SongList of the album
{
var thumb = await GetThumbImage(file, ThumbnailMode.MusicView, 150);
var songItem = new songModel() { StorageFile = file, ThumbImage = thumb };//songModel is a song class
this.mediaCollection.Add(songItem);
if (MultiplePhoto.Instance.SongItems.Count > 0) //SongItems contains the selected songlist
if (MultiplePhoto.Instance.SongItems.FirstOrDefault(x => x.StorageFile.Path == songItem.StorageFile.Path) != null) // check that is currently added song selected?
llms.SelectedItems.Add(this.mediaCollection[i]); //here addd the selected item to the lls
i++;
}https://stackoverflow.com/questions/33942109
复制相似问题