StorageFolderQueryResult.FindStartIndexAsync(Object) StorageFolderQueryResult.FindStartIndexAsync(Object) StorageFolderQueryResult.FindStartIndexAsync(Object) StorageFolderQueryResult.FindStartIndexAsync(Object) StorageFolderQueryResult.FindStartIndexAsync(Object) Method

Definition

Retrieves the index of the folder 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<unsigned int> FindStartIndexAsync(Platform::Object value)
IAsyncOperation<uint32_t> FindStartIndexAsync(winrt::Windows::Foundation::IInspectable value) const;
public IAsyncOperation<uint> FindStartIndexAsync(Object value)
Public Function FindStartIndexAsync(value As Object) As IAsyncOperation(Of uint)
Windows.Storage.Search.StorageFolderQueryResult.findStartIndexAsync(value).done( /* Your success and error handlers */ );

Parameters

value
Object Object Object

The property value to match when searching the query results. The property to that is used to match this value is the property in the first SortEntry of the QueryOptions.SortOrder list.

Returns

When this method completes successfully it returns the index of the matched folder in the query results; otherwise it returns uint.MaxValue.

Examples

This example shows how to find the first album that has a title that begins with an "R" in a set of query results that contains albums sorted by title.


QueryOptions queryOptions = new QueryOptions();
queryOptions.FolderDepth = FolderDepth.Deep;
queryOptions.IndexerOption = IndexerOption.OnlyUseIndexer;
SortEntry album = new SortEntry();
album.AscendingOrder = true;
album.PropertyName = "System.Music.AlbumTitle";
queryOptions.SortOrder.Add(album);

StorageFolderQueryResult queryResult = musicFolder.CreateFolderQueryWithOptions(queryOptions);
var firstIndex = await queryResult.FindStartIndexAsync("R");
var queryOptions = new Windows.Storage.Search.QueryOptions();
queryOptions.folderDepth = Windows.Storage.Search.FolderDepth.deep;
queryOptions.indexerOption = Windows.Storage.Search.IndexerOptions.onlyUseIndexer;
queryOptions.sortOrder.append({
 ascendingOrder: true,
 propertyName: "System.Music.AlbumTitle"
});

var queryResult = Windows.Storage.KnownFolders.picturesLibrary.createFolderQueryWithOptions(queryOptions);
var firstIndex = queryResult.findStartIndexAsync("R");