Search code examples
c#asynchronousuwppicker

Selecting multiple folders async in UWP with C#


I'm writing an application where I need the user to select multiple folders that contain elements (pictures) I need to process. I can see in the UWP pickers PickMultipleFilesAsync and PickSingleFolderAsync, but there does not seem to be any PickMultipleFoldersAsync or anyting like this?

Any hints on how to do this and still complying to the UWP standard?


Solution

  • no, technically there is not any PickMultipleFoldersAsync method, you can just pick 1 top folder and then query only the required files in it and all its subfolders as well with query : https://learn.microsoft.com/en-us/windows/uwp/files/quickstart-listing-files-and-folders

    Moreover you can pick all items with :

    IReadOnlyList<IStorageItemitemsList = await picturesFolder.GetItemsAsync();
    

    This gets you all files and folders within the folder picturesFolder in this particular case.

    if you specifically want the PickMultipleFoldersAsync API in official SDK, you can vote it on UserVoice