Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

WinUI 3: ThemeListener crashes #3656

Open

Description

@ocalvo

Describe the bug

Creating ThemeListener crashes

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

  • Can this be reproduced in the Sample App? Yes

Steps to reproduce the behavior:

  1. Create a new WinUI3 Desktop app using version latest internal version on WinUI3
  2. Add a reference to WCT preview 3:
3. Write this code in App.xaml.cs:
  protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
  {
     var t = new Microsoft.Toolkit.Uwp.UI.Helpers.ThemeListener();
  1. F5

Expected behavior

App does not crash.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

NuGet Package(s): 
8.0.0-preview3

Package Version(s): 
WinUI3 latest internal version

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2019 (version: ) 
- [x] 2019 Preview (version: 2)

Additional context

Add any other context about the problem here.

Activity

  1. added
    bug 🐛
    on Jan 5, 2021
  2. added
    external ⤴️
    WinUI 💠
    and removed on Jan 5, 2021
  3. added this to the WinUI3 milestone on Jan 5, 2021
  4. changed the title [-]ThemeListener crashes[/-] [+]WinUI 3: ThemeListener crashes[/+] on Jan 5, 2021
  5. Marv51 commented on Mar 30, 2021

    @Marv51
    Contributor

    Probably related to this entry in the WinUI 3 release note:
    "The UISettings.ColorValuesChanged Event and AccessibilitySettings.HighContrastChanged Event are no longer supported in desktop apps. This may cause issues if you are using it to detect changes in Windows themes."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WinUI 💠bug 🐛external ⤴️sdkcheck 🏁

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions