WakeLockSentinel Class

A wake lock acquired by WakeLock.Request (https://w3c.github.io/screen-wake-lock/#the-wakelocksentinel-interface): its release event is fired when it is released by WakeLockSentinel.Release or by the user agent.

public sealed class WakeLockSentinel : EventTarget
Inheritance
EventTarget WakeLockSentinel

Properties

NameDescription
OnReleaseGets or sets the event handler of the release event.
ReleasedGets whether the lock was released.
TypeGets the type of the lock.

OnRelease

WakeLock.cs

Gets or sets the event handler of the release event.

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

Released

WakeLock.cs

Gets whether the lock was released.

public bool Released { get; }

Gets the type of the lock.

public WakeLockType Type { get; }

Methods

NameDescription
Release()Releases the lock (https://w3c.github.io/screen-wake-lock/#the-release-method); the release event is fired before the method returns.

Release()

WakeLock.cs

Releases the lock (https://w3c.github.io/screen-wake-lock/#the-release-method); the release event is fired before the method returns.

public Task Release()