Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 3.61 KB

deviceinformation.md

File metadata and controls

38 lines (23 loc) · 3.61 KB
-api-id -api-type
T:Windows.Devices.Enumeration.DeviceInformation
winrt class

Windows.Devices.Enumeration.DeviceInformation

-description

Represents a device. This class allows access to well-known device properties as well as additional properties specified during device enumeration.

-remarks

A DeviceInformation object is composed of an identity (DeviceInformation.Id), a kind (DeviceInformation.Kind), and a property bag (DeviceInformation.Properties). All of the other properties of a DeviceInformation object are derived from the Properties property bag. For example, Name is derived from System.ItemNameDisplay.

Successful completion of FindAllAsync results in a DeviceInformationCollection containing DeviceInformation objects.

If a call to CreateWatcher succeeds, a DeviceInformation object is passed to the added event for each device that is found.

The Name property should only be used for display purposes only and not for finding a device because the Name can change due to localization or a user assigning a name.

CreateFromIdAsync creates a DeviceInformation object if successful.

The DeviceInformation class provides device information, but more specifically, it provides properties of the device interface, the interface that represents functionality that the device exposes. Multi-function devices may have more than one device interface. The physical object that a user sees as a device, is known as the device container, and has properties such as Manufacturer and ModelID. For more information about enumerating devices and recovering properties, see Enumerate devices.

-examples

This example incrementally enumerates devices, adding them to a list each time a device is found, and also handling removals and updates.

[!code-jsCreateWatcherAllDevicesJs]

[!code-csharpCreateWatcherAllDevicesCs]

-see-also

Camera profiles sample (Windows 10), Camera preview frame sample (Windows 10), Basic camera app sample (Windows 10), Camera resolution sample (Windows 10), Custom USB device sample (Windows 10), Camera face detection sample (Windows 10), Video stabilization sample (Windows 10), Manual camera controls sample (Windows 10), High dynamic range sample (Windows 10)