Dela via


ProximitySensorDisplayOnOffController Class

Definition

Provides a controller responsible for turning on or off the phone display based on the readings from the ProximitySensor.

public ref class ProximitySensorDisplayOnOffController sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ProximitySensorDisplayOnOffController final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ProximitySensorDisplayOnOffController : System.IDisposable
Public NotInheritable Class ProximitySensorDisplayOnOffController
Implements IDisposable
Inheritance
Object Platform::Object IInspectable ProximitySensorDisplayOnOffController
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

This class will have no effect if your app is running on a platform that doesn't support a controller for the display state. For example, this class has no effect on applications running on a desktop because the desktop platform does not support a controller cycling the display.

Methods

Close()

Disconnects this ProximitySensorDisplayOnOffController instance from the service and frees all the allocated resources.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Applies to

See also