共用方式為


DisplayInformation.DisplayContentsInvalidated 事件

定義

當顯示器需要重新繪製時發生。

// Register
static event_token DisplayContentsInvalidated(TypedEventHandler<DisplayInformation, IInspectable const&> const& handler) const;

// Revoke with event_token
static void DisplayContentsInvalidated(event_token const* cookie) const;

// Revoke with event_revoker
static DisplayInformation::DisplayContentsInvalidated_revoker DisplayContentsInvalidated(auto_revoke_t, TypedEventHandler<DisplayInformation, IInspectable const&> const& handler) const;
public static event TypedEventHandler<DisplayInformation,object> DisplayContentsInvalidated;
function onDisplayContentsInvalidated(eventArgs) { /* Your code */ }
Windows.Graphics.Display.DisplayInformation.addEventListener("displaycontentsinvalidated", onDisplayContentsInvalidated);
Windows.Graphics.Display.DisplayInformation.removeEventListener("displaycontentsinvalidated", onDisplayContentsInvalidated);
- or -
Windows.Graphics.Display.DisplayInformation.ondisplaycontentsinvalidated = onDisplayContentsInvalidated;
Public Shared Custom Event DisplayContentsInvalidated As TypedEventHandler(Of DisplayInformation, Object) 

事件類型

備註

此事件是靜態的。

由於此事件是靜態的,因此建議您直接從 DisplayInformation 物件存取它,而不是從您從 呼叫 DisplayInformation.GetForCurrentView 方法取得的目前實體顯示資訊存取它。

適用於