Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows.UI.ViewManagement.UISettings.ColorValueChanged does not trigger in WinUI3 app on Windows 10 #4006

Open
HO-COOH opened this issue Nov 30, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@HO-COOH
Copy link

HO-COOH commented Nov 30, 2023

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

  1. Create a new C++ WinUI3 app (packaged)
  2. In MainWindow.xaml.h, add a member
struct MainWindow : MainWindowT<MainWindow>
{
    ...
    winrt::Windows::UI::ViewManagement::UISettings settings;
};
  1. In MainWIndow.xaml.cpp
    MainWindow::MainWindow()
    {
        settings.ColorValuesChanged([](auto...)
            {
                OutputDebugString(L"Triggered");
            });
    }
  1. 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

@DarranRowe
Copy link

I think the issue with ColorValueChanged is that there is documentation stating that it isn't supported. It could be that it wasn't working in Windows 10, but has since been made to work in 11.

@HO-COOH
Copy link
Author

HO-COOH commented Nov 30, 2023

I think the issue with ColorValueChanged is that there is documentation stating that it isn't supported. It could be that it wasn't working in Windows 10, but has since been made to work in 11.

I think that's a lie. It works even with a WPF app.
image

@DarranRowe
Copy link

First, remember that "not supported" is not the same as "doesn't work". It normally means that Microsoft doesn't intend for it to work, but if it works then it is good for you. However, if it doesn't work then they will not support you.

Secondly, is the WPF application packaged?

@HO-COOH
Copy link
Author

HO-COOH commented Dec 18, 2023

First, remember that "not supported" is not the same as "doesn't work". It normally means that Microsoft doesn't intend for it to work, but if it works then it is good for you. However, if it doesn't work then they will not support you.

Secondly, is the WPF application packaged?

I use whatever project template visual studio comes with, so the WPF application is not packaged. At this point, I think Microsoft should just update the documentation, what works under which framework, packaged/unpackaged, and what was quitely made to work with Windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants