Folder Picker

The folder picker is a powerful component, perhaps more so than most users realize. If a user selects an existing folder, or uses it to name a new folder, he or she is giving your app read/write access to the entire folder, including subfolders! Note that only appropriate folders are exposed via the folder picker, so the user can never select the Program Files or Windows folders, for example.

The folder picker is exposed as a FolderPicker class, also in the Windows.Storage.Pickers namespace.

The FolderPicker works similarly to the other two classes:

  // Get an entire folder from the user   FolderPicker picker = new FolderPicker();   picker.FileTypeFilter.Add("*"); #if WINDOWS_PHONE_APP   picker.PickFolderAndContinue(); ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.