Open
Description
Describe the bug
Windows.UI.ViewManagement.UISettings.ColorValueChanged
does not trigger when changing dark/light mode in system settings with WinUI3 (packaged) app under windows 10.
UWP app does not have such issue.
This issue ONLY seems to happen on Windows 10. I tried on both 17763 and 19045 and both are having issues (and both are working properly with UWP app, which is kind of funny). On Windows 11 22621, no issues.
Steps to reproduce the bug
- Create a new C++ WinUI3 app (packaged)
- In
MainWindow.xaml.h
, add a member
struct MainWindow : MainWindowT<MainWindow>
{
...
winrt::Windows::UI::ViewManagement::UISettings settings;
};
- In
MainWIndow.xaml.cpp
MainWindow::MainWindow()
{
settings.ColorValuesChanged([](auto...)
{
OutputDebugString(L"Triggered");
});
}
- Put a breakpoint on the
OutputDebugString
line, build and run. Toggle dark/light mode in system settings, the breakpoint is NOT hit.
Expected behavior
No response
Screenshots
WinUI3 (left) <--------------------> UWP (right)
2023-11-30.23-24-16.mp4
NuGet package version
Windows App SDK 1.4.3: 1.4.231115000
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 22H2 (19045, 2022 Update), Windows 10 version 1809 (17763, October 2018 Update)
IDE
Visual Studio 2022
Additional context
No response