DevicePosture Class

The posture of the device for a document (https://w3c.github.io/device-posture/#the-deviceposture-interface, navigator.devicePosture), read from the DevicePostureProvider of the browsing context (DevicePostureOptions.Provider): the change event is fired when it changes, while the document is visible.

public sealed class DevicePosture : EventTarget
Inheritance
EventTarget DevicePosture

Properties

NameDescription
OnChangeGets or sets the event handler of the change event.
TypeGets the current posture of the device (the [[CurrentPosture]] slot of the document).

Gets or sets the event handler of the change event.

public Action<Event>? OnChange { get; set; }

Gets the current posture of the device (the [[CurrentPosture]] slot of the document).

public DevicePostureType Type { get; }