How to restrict the number of folders being returned by Known Folder library in Windows Phone 8.1?

45 Views Asked by At
IReadOnlyList<IStorageItem> PicturesLibrary = await KnownFolders.PicturesLibrary.GetFoldersAsync();
await Pass_it_to_afunction(PicturesLibrary);

Known Folders are great. I love 'em. In this particular context, I am using Picture Library from Known Folders Class to get all the folders. So, if there are 50 folders, all the 50 folders will be returned at once. I don't want it like that.

I am thinking about something like the concept of "pagination". Return first 20 folders initiall, next 20 in next event(a button click or something), next 20 in next event (since there are only 10 folders left, 10 folders will be returned). Is that possible? IDK. I haven't implemented it yet. IDK how to do that either.

I would like to hear propostions. Any suggestions/sample/comments/downvotes or anything useful would be greatful. Well....Useful & Greatful rhymes.

1

There are 1 best solutions below

1
On BEST ANSWER

What about Take (LINQ)? It returns the desired amount of elements from the beginning.

http://msdn.microsoft.com/de-de/library/bb503062%28v=vs.110%29.aspx