共用方式為


Window.VisibilityChanged 事件

定義

發生于 Visible 屬性的值變更時。

// Register
event_token VisibilityChanged(TypedEventHandler<IInspectable, WindowVisibilityChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
Window::VisibilityChanged_revoker VisibilityChanged(auto_revoke_t, TypedEventHandler<IInspectable, WindowVisibilityChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<object,WindowVisibilityChangedEventArgs> VisibilityChanged;
function onVisibilityChanged(eventArgs) { /* Your code */ }
window.addEventListener("visibilitychanged", onVisibilityChanged);
window.removeEventListener("visibilitychanged", onVisibilityChanged);
- or -
window.onvisibilitychanged = onVisibilityChanged;
Public Custom Event VisibilityChanged As TypedEventHandler(Of Object, WindowVisibilityChangedEventArgs) 

事件類型

備註

VisibilityChangedEventArgs 包含布林 Visible 值屬性,您應該檢查以判斷目前的可見度狀態。

適用於

另請參閱