LocalContentSuggestionSettings.Locations | locations property
A list of the storageFolder objects that contain files that are used to provide suggestions. If the list is empty, suggestions are provided from files in all of the local libraries for which the app declared capabilities.
The list of storageFolder locations that contain files that are used to provide suggestions. By default, this list is empty and suggestions are provided from the local files in all of the libraries for which the app declared capabilities.
If you add a location to the list, make sure you add all of the locations that contain files that you want used to provide local suggestions. If a location in this list is not valid, no suggestions are provided from that location. The remaining (valid) locations in this list are then used to provide suggestions.
Suggestions are provided based on local, indexed files in a listed storageFolder.
If local suggestions are disabled, this property has no effect. Set the localContentSuggestionSettings.enabled property to true to display local suggestions in the search pane.
You can use this list to provide suggestions from libraries or folders for which your app hasn't declared capabilities, like folders that were accessed using the file picker. Learn more about capabilities in Access to user resources using the Windows Runtime.
The Search contract sample demonstrates how to append a location to the list:
var localSuggestionSettings = new Windows.ApplicationModel.Search.LocalContentSuggestionSettings(); localSuggestionSettings.enabled = true; localSuggestionSettings.locations.append(Windows.Storage.KnownFolders.musicLibrary);
Note If there is only one storageFolder in the locations list, like the Music library in the example, the local files in that location only are used to provide suggestions in the search pane.
Minimum supported client
Minimum supported server
|Windows Server 2012|
Minimum supported phone
- Access to user resources using the Windows Runtime
- Quickstart: Adding search
- Search contract sample
- Object class
- LocalContentSuggestionSettings class
- LocalContentSuggestionSettings.Enabled property
- SearchPane.SetLocalContentSuggestionSettings method
- Windows.Storage.KnownFolders class
- Windows.Storage.StorageFolder class