I​Storage​Query​Result​Base I​Storage​Query​Result​Base I​Storage​Query​Result​Base Interface


Provides methods to access to and manage query results.

public interface IStorageQueryResultBasepublic interface IStorageQueryResultBasePublic Interface IStorageQueryResultBase
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


Folder Folder Folder

Gets the folder originally used to create a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object. This folder represents the scope of the query.

public StorageFolder Folder { get; }public StorageFolder Folder { get; }Public ReadOnly Property Folder As StorageFolder
StorageFolder StorageFolder StorageFolder

The original folder.



ApplyNewQueryOptions(QueryOptions) ApplyNewQueryOptions(QueryOptions) ApplyNewQueryOptions(QueryOptions)

Applies new query options to the results retrieved by the StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public void ApplyNewQueryOptions(QueryOptions newQueryOptions)public void ApplyNewQueryOptions(QueryOptions newQueryOptions)Public Function ApplyNewQueryOptions(newQueryOptions As QueryOptions) As void
QueryOptions QueryOptions QueryOptions

The new query options.



When this method returns, the contents of the query and the count of items reflect the new query options.

This method causes the OptionsChanged event to fire.

FindStartIndexAsync(Object) FindStartIndexAsync(Object) FindStartIndexAsync(Object)

Retrieves the index of the file from the query results that most closely matches the specified property value. The property that is matched is determined by the first SortEntry of the QueryOptions.SortOrder list.

public IAsyncOperation<uint> FindStartIndexAsync(Object value)public IAsyncOperation<uint> FindStartIndexAsync(Object value)Public Function FindStartIndexAsync(value As Object) As IAsyncOperation( Of uint )
System.Object System.Object System.Object

The property value to match when searching the query results.


When this method completes successfully it returns the index of the matched item in the query results.



You can use this index in conjunction with Semantic Zoom to determine where the page should be zoomed in after the user selects the Semantic Zoom control.

GetCurrentQueryOptions() GetCurrentQueryOptions() GetCurrentQueryOptions()

Retrieves the query options used to create a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public QueryOptions GetCurrentQueryOptions()public QueryOptions GetCurrentQueryOptions()Public Function GetCurrentQueryOptions() As QueryOptions

GetItemCountAsync() GetItemCountAsync() GetItemCountAsync()

Retrieves the number of items that match the query that created a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public IAsyncOperation<uint> GetItemCountAsync()public IAsyncOperation<uint> GetItemCountAsync()Public Function GetItemCountAsync() As IAsyncOperation( Of uint )

When this method completes successfully, it returns the number of items that match the query.



ContentsChanged ContentsChanged ContentsChanged

Fires when an item is added, deleted or modified in the folder being queried.

public abstract event TypedEventHandler ContentsChangedpublic abstract event TypedEventHandler ContentsChangedPublic MustInherit Event ContentsChanged


If you register a handler for this event, keep that handler registered while you suspend your app (in response to oncheckpoint or Suspending ). Your app will not receive ContentsChanged events while it is suspended and when your app resumes it will receive a single event that aggregates all of the changes if any occurred.

Additionally, keep in mind that registering and removing event handlers are synchronous operations and might cause your app to stop responding briefly if you execute them on your app's UI thread. Wherever possible, use a thread other than your app's UI thread to register and unregister these event handlers.

OptionsChanged OptionsChanged OptionsChanged

Fires when the query options are changed for a StorageFileQueryResult, StorageFolderQueryResult, or StorageItemQueryResult object.

public abstract event TypedEventHandler OptionsChangedpublic abstract event TypedEventHandler OptionsChangedPublic MustInherit Event OptionsChanged