-
Notifications
You must be signed in to change notification settings - Fork 4
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
Having a hard time applying ThemeService settings to all open windows #26
Comments
I just reviewed https://ghost1372.github.io/DevWinUI/themeService/ and I'm still missing something apparently because I still cannot get it to work right across multiple windows. |
Hi @MPITech https://ghost1372.github.io/DevWinUI/themeService/ i have a working sample which i can open some windows and change backdrop for all windows. // Open Windows
a button which can randomly change backdrop:
you should know that when window is opening/Activated, we need to set default backdrop so i think here you have some issues and you think it is not working.
Unfortunately, now that I've checked, TintColor has a bug and only applies to one window. I'll try to fix this problem soon. |
Thanks a lot. I will make some changes and see if I can get it to work now that I have a better handle on what methods to use and where to use them. And I am glad you found the tint color problem with multiple windows. I'll have to see why I couldn't get it to work on even my first window anymore. Will be in touch shortly. |
Ok, i fixed TintColor issue and now we can change tint color for all windows. |
Thanks, It looks like the main window correctly recolors all controls, but the additional windows do not correctly change all controls. For example, many TextBlocks that were showing white text when Dark theme is set will still show white text when switching to Light in all of the secondary windows. If I exit the app and restart it in Light mode from the start, these windows/controls appear correctly, with black TextBlocks. I verified and none of the controls' foregrounds are manually set anywhere, so that isn't the issue. Are you able to replicate this as well? Thanks again! |
I think I isolated the issue to the problem only happening with controls that are inside UserControls in each window. They aren't recoloring properly when the parent window's content's ActualTheme is changed. |
@MPITech |
@MPITech I Fixed ThemeService |
Was "Test" in a UserControl? I'll try the new version when it is posted to Nuget and see if it helps. Thanks! |
Yes.
i get white text in dark and black text in Light which is correct. |
Thanks, I will try and get more details for replicating when I install the next preview. When do you anticipate that will be on nuget? Thanks! |
i am waiting for WinUI Community Call, If they release a new version soon, I'll wait. If there isn't a new version, I'll release it by the end of the week. |
Hi. I had the tint working at one point but then you told me that the ThemeService shouldn't be initialized for every window and that TrackWindow should help changes apply to all open windows. However, I'm having a hard time getting it to work now after making some changes. The example in the gallery app only shows how to initialize and not how to make changes and apply to all open windows.
I've tried different combinations of these methods when I change any of my Settings.Local.XXX properties where I save the user's backdrop, tint color, and theme settings:
And still, I cannot get the TINT color to apply anymore on ANY window, and the dark/light setting only applies to the main window that I initialized the ThemeService on.
Can you please explain how to properly initialize the backdrop, theme, and tint color on startup? What is the difference between "Set___" and "Configure___" methods in ThemeService?
Also, can you please explain how to properly apply changes to tint color, for example, to all open windows? I checked in debug mode, my windows are properly added using DevWinUI.WindowHelper.TrackWindow in my custom CreateWindow method (I had to use my own).
Adding these explanations to the Gallery App may be helpful to others going forward as well. 🚀
Thanks a lot!
The text was updated successfully, but these errors were encountered: