StorageLibrary StorageLibrary StorageLibrary StorageLibrary StorageLibrary Class


Lets you add and remove folders from a library like Music or Videos and lets you get a list of folders included in the library.

public : sealed class StorageLibrary
struct winrt::Windows::Storage::StorageLibrary
public sealed class StorageLibrary
Public NotInheritable Class StorageLibrary
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


You can only access libraries that you have declared capabilities for in your app manifest. To learn more about capabilities see, App capability declarations.

Version history

Windows version SDK version Value added
1511 10586 GetLibraryForUserAsync
1607 14393 ChangeTracker
1709 16299 AreFolderSuggestionsAvailableAsync


ChangeTracker ChangeTracker ChangeTracker ChangeTracker ChangeTracker

Returns the StorageLibraryChangeTracker associated with the storage library.

Folders Folders Folders Folders Folders

Gets the folders in the current library.

SaveFolder SaveFolder SaveFolder SaveFolder SaveFolder

Get the default save folder for the current library.


AreFolderSuggestionsAvailableAsync() AreFolderSuggestionsAvailableAsync() AreFolderSuggestionsAvailableAsync() AreFolderSuggestionsAvailableAsync() AreFolderSuggestionsAvailableAsync()

Determines if there are suggestions for adding existing folders with content to the StorageLibrary.

GetLibraryAsync(KnownLibraryId) GetLibraryAsync(KnownLibraryId) GetLibraryAsync(KnownLibraryId) GetLibraryAsync(KnownLibraryId) GetLibraryAsync(KnownLibraryId)

Gets the specified library.

GetLibraryForUserAsync(User, KnownLibraryId) GetLibraryForUserAsync(User, KnownLibraryId) GetLibraryForUserAsync(User, KnownLibraryId) GetLibraryForUserAsync(User, KnownLibraryId) GetLibraryForUserAsync(User, KnownLibraryId)

Gets the specified library for a User.

RequestAddFolderAsync() RequestAddFolderAsync() RequestAddFolderAsync() RequestAddFolderAsync() RequestAddFolderAsync()

Prompts the user to select a folder, and then adds the folder to the library.

RequestRemoveFolderAsync(StorageFolder) RequestRemoveFolderAsync(StorageFolder) RequestRemoveFolderAsync(StorageFolder) RequestRemoveFolderAsync(StorageFolder) RequestRemoveFolderAsync(StorageFolder)

Prompts the user to confirm removal of the specified folder from the current library, and then removes the folder.


DefinitionChanged DefinitionChanged DefinitionChanged DefinitionChanged DefinitionChanged

Occurs when the list of folders in the current library changes.

See also