Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 2.55 KB

deviceinformation_createwatcher_490167309.md

File metadata and controls

36 lines (25 loc) · 2.55 KB
-api-id -api-type
M:Windows.Devices.Enumeration.DeviceInformation.CreateWatcher(System.String,Windows.Foundation.Collections.IIterable{System.String})
winrt method

Windows.Devices.Enumeration.DeviceInformation.CreateWatcher

-description

Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string and the specified collection of properties.

-parameters

-param aqsFilter

An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.

-param additionalProperties

An iterable list of additional properties to include in the Properties property of the DeviceInformation objects in the enumeration results. For more info on what the properties represent, see Device information properties.

-returns

The created DeviceWatcher.

-remarks

The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.

Note

An app must subscribe to all of the added, removed, and updated events to be notified when there are device additions, removals or updates. If an app handles only the added event, it will not receive an update if a device is added to the system after the initial device enumeration completes.

See the DeviceWatcher class for an example.

-examples

-see-also

CreateWatcher, CreateWatcher(DeviceClass), CreateWatcher(String)