StorageFolder.CreateItemQueryWithOptions(QueryOptions) StorageFolder.CreateItemQueryWithOptions(QueryOptions) StorageFolder.CreateItemQueryWithOptions(QueryOptions) StorageFolder.CreateItemQueryWithOptions(QueryOptions) StorageFolder.CreateItemQueryWithOptions(QueryOptions) Method

Definition

Gets a query result object that contains the files and subfolders in the current folder and, optionally, in the subfolders of the current folder. The results are based on the specified QueryOptions.

public : StorageItemQueryResult CreateItemQueryWithOptions(QueryOptions queryOptions)
StorageItemQueryResult CreateItemQueryWithOptions(QueryOptions queryOptions) const;
public StorageItemQueryResult CreateItemQueryWithOptions(QueryOptions queryOptions)
Public Function CreateItemQueryWithOptions(queryOptions As QueryOptions) As StorageItemQueryResult
var storageItemQueryResult = storageFolder.createItemQueryWithOptions(queryOptions);
Parameters
queryOptions
QueryOptions QueryOptions QueryOptions

The criteria that are applied to the query.

Returns

A query result object. Call the GetItemsAsync method of the query result to get the files and subfolders in the current folder and, optionally, in the subfolders of the current folder, filtered and sorted based on the specified QueryOptions. This method returns a list of type IReadOnlyList<IStorageItem >. Each file or folder is represented by an item of type IStorageItem.

To work with the returned items, call the IsOfType method of the IStorageItem interface to determine whether each item is a file or a folder. Then cast the item to a StorageFolder or StorageFile.

Exceptions
UnauthorizedAccessException UnauthorizedAccessException UnauthorizedAccessException

You don't have permission to access the contents of the current folder.

ArgumentException ArgumentException ArgumentException

You specified a value other than DefaultQuery from the CommonFileQuery or CommonFolderQuery enumeration for a folder that's not a library folder.

Remarks

For more information and examples on getting query result objects, see CreateFileQueryWithOptions.