DisplaySource.StatusChanged 事件

定义

当 DisplaySource.Status 属性的值更改时引发的事件。 了解 DisplaySource 状态可让你了解系统状态转换,并让你有机会处理这些状态更改。

// 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) 

事件类型

Windows 要求

设备系列
Windows 11 (在 10.0.22000.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v14.0 中引入)

适用于

另请参阅