語言

AccessibilitySettings.HighContrastChanged 活動

定義

當系統高對比度功能開啟或關閉時,會發生這種情況。

// Register
event_token HighContrastChanged(TypedEventHandler<AccessibilitySettings, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
AccessibilitySettings::HighContrastChanged_revoker HighContrastChanged(auto_revoke_t, TypedEventHandler<AccessibilitySettings, IInspectable const&> const& handler) const;
public event TypedEventHandler<AccessibilitySettings,object> HighContrastChanged;
function onHighContrastChanged(eventArgs) { /* Your code */ }
accessibilitySettings.addEventListener("highcontrastchanged", onHighContrastChanged);
accessibilitySettings.removeEventListener("highcontrastchanged", onHighContrastChanged);
- or -
accessibilitySettings.onhighcontrastchanged = onHighContrastChanged;
Public Custom Event HighContrastChanged As TypedEventHandler(Of AccessibilitySettings, Object) 

事件類型

備註

警告

此事件依賴當前執行緒的 CoreWindow 。 WinUI 3 的桌面視窗沒有 CoreWindow 支援,所以不要在 WinUI 3 桌面應用程式中使用這個事件。 在 Windows 應用程式 SDK 1.4 及更新版本中,請改用 ThemeSettings.Changed 事件。 透過呼叫 ThemeSettings.CreateForWindowId,為你的應用程式視窗建立一個 ThemeSettings 物件,並保留對該物件的參考,直到你想要收到變更通知為止。

適用於