Libraries and Other Special Folders

With the right capability granted to your app, you can access the user’s Music, Pictures, or Videos libraries without any prompt or file picker. (The Documents Library capability is more restrictive, because it works only for file type associations registered by the app, discussed in Chapter 21.) The same is true for a few more special folders: the HomeGroup folder, the removable devices folder, and the DLNA devices folder.

Accessing Known Folders

Accessing any of the special folders is trivial, thanks to a static KnownFolders class that exposes several StorageFolder properties. As with the different types of app files, all you need to do is start off with the right StorageFolder. For example:

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.