共用方式為


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 引進)

適用於

另請參閱