NeighboringFilesQuery | neighboringFilesQuery property

FileActivatedEventArgs.NeighboringFilesQuery property

Gets the neighboring files of the files for which the app was activated.


public StorageFileQueryResult NeighboringFilesQuery { get; }

Property value

Type: StorageFileQueryResult

The StorageFile objects that represent the neighboring files of the files being passed to the app.


Apps that activate to handle file associations get an object that represents the invoked file only. This can be a problem for media gallery apps in which users expect to navigate to neighboring files. Use the NeighboringFilesQuery property to get the collection of the files in the surrounding view, which is the collection that the invoked file was selected from.

Your apps need to declare a library capability to get items of the corresponding type. To get pictures in the NeighboringFilesQuery, you need the Pictures library capability, and to get music files, you need the Music library capability.

The NeighboringFilesQuery property is available only when a single file is invoked. If the size of the Files collection is more than 1, the value of NeighboringFilesQuery is null. Also, the query is not always available for all invocations, so you can use it only if present.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::ApplicationModel::Activation [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

None supported


Windows::ApplicationModel::Activation [C++]



See also




© 2016 Microsoft