-
Notifications
You must be signed in to change notification settings - Fork 437
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
How to get a system theme with ThemeManager? #9
Comments
In theory, your code should work and Without seeing the code it can be hard to tell what exactly went wrong in your case. One issue I see is that both ModernWPF and FluentWPF are trying to set the window style (through attached property) and only one will take effect. For the moment I believe using the FluentWPF style would be simpler. The resources in App.xaml also need to be set up in a certain way to get the two libraries work together without conflicts. I made a sample app available here to demonstrate the setup. |
Thank you reaally much for your answer and support!!😊😊 |
Slightly off topic, but what would be the purpose behind using both FluentWPF and ModernWpf? I thought ModernWpf was, more or less, a replacement for FluentWPF. Is it so your app can make use of the acrylic effect? |
I think, that to make an acrylic effect, the best way is by using FluentWPF. |
I'm still getting this issue, but at least, they do not conflict with themes. |
Ah, now I see you want the app to use the Windows theme mode. Simply adding a proper app manifest should enable that. This commit 84f4069 shows how to do that. Basically you add an app manifest to your project and uncomment the Windows 10 line. If your app still doesn't pick up the Windows theme (don't forget to remove any |
Hey @Kinnara, Since the requirement for app.manifest is now optional, apps will now follows system themes without any additional requirements. The OP's problem was, they couldn't fetch system theme because they didn't have the manifest and didn't know it was required. Can this issue be closed now? |
Yes, I believe so. Thanks for the reminder. |
tbsys.Text = ModernWpf.ThemeManager.GetActualTheme(this).ToString();
This does not return me an actual theme, it returns a requested theme, but if there isno requested theme, then it returns default.
The text was updated successfully, but these errors were encountered: