DeviceInformationPairing DeviceInformationPairing DeviceInformationPairing DeviceInformationPairing Class

Definition

Contains information and enables pairing for a device.

public : sealed class DeviceInformationPairing : IDeviceInformationPairing, IDeviceInformationPairing2
public sealed class DeviceInformationPairing : IDeviceInformationPairing, IDeviceInformationPairing2
Public NotInheritable Class DeviceInformationPairing Implements IDeviceInformationPairing, IDeviceInformationPairing2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

CanPair CanPair CanPair CanPair

Gets a value that indicates whether the device can be paired.

public : Platform::Boolean CanPair { get; }
public bool CanPair { get; }
Public ReadOnly Property CanPair As bool
var bool = deviceInformationPairing.canPair;
Value
Platform::Boolean bool bool bool

True if the device can be paired, otherwise false.

Custom Custom Custom Custom

Gets the DeviceInformationCustomPairing object necessary for custom pairing.

public : DeviceInformationCustomPairing Custom { get; }
public DeviceInformationCustomPairing Custom { get; }
Public ReadOnly Property Custom As DeviceInformationCustomPairing
var deviceInformationCustomPairing = deviceInformationPairing.custom;
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

IsPaired IsPaired IsPaired IsPaired

Gets a value that indicates whether the device is currently paired.

public : Platform::Boolean IsPaired { get; }
public bool IsPaired { get; }
Public ReadOnly Property IsPaired As bool
var bool = deviceInformationPairing.isPaired;
Value
Platform::Boolean bool bool bool

True if the device is currently paired, otherwise false.

ProtectionLevel ProtectionLevel ProtectionLevel ProtectionLevel

Gets the level of protection used to pair the device.

public : DevicePairingProtectionLevel ProtectionLevel { get; }
public DevicePairingProtectionLevel ProtectionLevel { get; }
Public ReadOnly Property ProtectionLevel As DevicePairingProtectionLevel
var devicePairingProtectionLevel = deviceInformationPairing.protectionLevel;
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Methods

PairAsync() PairAsync() PairAsync() PairAsync()

Attempts to pair the device.

public : IAsyncOperation<DevicePairingResult> PairAsync()
public IAsyncOperation<DevicePairingResult> PairAsync()
Public Function PairAsync() As IAsyncOperation( Of DevicePairingResult )
var iAsyncOperation = deviceInformationPairing.pairAsync();
Returns
See Also

PairAsync(DevicePairingProtectionLevel) PairAsync(DevicePairingProtectionLevel) PairAsync(DevicePairingProtectionLevel) PairAsync(DevicePairingProtectionLevel)

Attempts to pair the device using a provided level of protection.

public : IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel)
public IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel)
Public Function PairAsync(minProtectionLevel As DevicePairingProtectionLevel) As IAsyncOperation( Of DevicePairingResult )
var iAsyncOperation = deviceInformationPairing.pairAsync(minProtectionLevel);
Parameters
minProtectionLevel
DevicePairingProtectionLevel DevicePairingProtectionLevel DevicePairingProtectionLevel DevicePairingProtectionLevel

The required level of protection to use for the pairing action.

Returns
See Also

PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings) PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings) PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings) PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings)

Attempts to pair a device object with a specified protection level and custom settings.

public : IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel, IDevicePairingSettings devicePairingSettings)
public IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel, IDevicePairingSettings devicePairingSettings)
Public Function PairAsync(minProtectionLevel As DevicePairingProtectionLevel, devicePairingSettings As IDevicePairingSettings) As IAsyncOperation( Of DevicePairingResult )
var iAsyncOperation = deviceInformationPairing.pairAsync(minProtectionLevel, devicePairingSettings);
Parameters
minProtectionLevel
DevicePairingProtectionLevel DevicePairingProtectionLevel DevicePairingProtectionLevel DevicePairingProtectionLevel

The required level of protection to use for the pairing action.

devicePairingSettings
IDevicePairingSettings IDevicePairingSettings IDevicePairingSettings IDevicePairingSettings

The custom device pairing settings.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
See Also

TryRegisterForAllInboundPairingRequests(DevicePairingKinds) TryRegisterForAllInboundPairingRequests(DevicePairingKinds) TryRegisterForAllInboundPairingRequests(DevicePairingKinds) TryRegisterForAllInboundPairingRequests(DevicePairingKinds)

Registers the application to handle all inbound pairing requests.

public : static Platform::Boolean TryRegisterForAllInboundPairingRequests(DevicePairingKinds pairingKindsSupported)
public static bool TryRegisterForAllInboundPairingRequests(DevicePairingKinds pairingKindsSupported)
Public Static Function TryRegisterForAllInboundPairingRequests(pairingKindsSupported As DevicePairingKinds) As bool
var bool = Windows.Devices.Enumeration.DeviceInformationPairing.tryRegisterForAllInboundPairingRequests(pairingKindsSupported);
Parameters
pairingKindsSupported
DevicePairingKinds DevicePairingKinds DevicePairingKinds DevicePairingKinds

The pairing kinds your app supports.

Returns
Platform::Boolean bool bool bool

Whether or not the attempt was successful.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

This API only works with Windows 10 IoT Core (IoT Core) applications.

UnpairAsync() UnpairAsync() UnpairAsync() UnpairAsync()

Attempts to unpair the device.

public : IAsyncOperation<DeviceUnpairingResult> UnpairAsync()
public IAsyncOperation<DeviceUnpairingResult> UnpairAsync()
Public Function UnpairAsync() As IAsyncOperation( Of DeviceUnpairingResult )
var iAsyncOperation = deviceInformationPairing.unpairAsync();
Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)