我正在使用wpToolkit的LongListMultiSelector。
我想从不同的专辑中选择不同的歌曲。
我想向用户显示"歌曲1","歌曲2"在尝试选择之前选择。但如果用户回到同一专辑,我无法标记之前选择的歌曲。
有没有办法做到这一点。
答案 0 :(得分:0)
使用专辑歌曲检查所选的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++;
}