AccessibilitySettings.HighContrastChanged Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the system high contrast feature turns on or off.
// 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)
Event Type
TypedEventHandler<AccessibilitySettings,IInspectable>
Remarks
Warning
This event depends on a CoreWindow for the current thread. WinUI 3 desktop windows aren't backed by CoreWindow, so don't use this event in a WinUI 3 desktop app. In Windows App SDK 1.4 and later, use the ThemeSettings.Changed event instead. Create a ThemeSettings object for your app window by calling ThemeSettings.CreateForWindowId, and retain a reference to the object for as long as you want to receive change notifications.