DisplaySource.StatusChanged Event

Definition

An event that's raised when the value of the DisplaySource.Status property changes. Knowledge of DisplaySource status gives you visibility into system state transitions, and gives you the opportunity to handle those state changes.

// Register
event_token StatusChanged(TypedEventHandler<DisplaySource, IInspectable const&> const& handler) const;

// Revoke with event_token
void StatusChanged(event_token const* cookie) const;

// Revoke with event_revoker
DisplaySource::StatusChanged_revoker StatusChanged(auto_revoke_t, TypedEventHandler<DisplaySource, IInspectable const&> const& handler) const;
public event TypedEventHandler<DisplaySource,object> StatusChanged;
function onStatusChanged(eventArgs) { /* Your code */ }
displaySource.addEventListener("statuschanged", onStatusChanged);
displaySource.removeEventListener("statuschanged", onStatusChanged);
- or -
displaySource.onstatuschanged = onStatusChanged;
Public Custom Event StatusChanged As TypedEventHandler(Of DisplaySource, Object) 

Event Type

Windows requirements

Device family
Windows 11 (introduced in 10.0.22000.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v14.0)

Applies to

See also