Comments (9)
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 RequestedTheme
) I also made some changes that should make system theme handling more robust. It's not published on NuGet yet but you can clone the latest code and try the FluentWPF sample.
from modernwpf.
As you see, a theme is not actually light.
from modernwpf.
In theory, your code should work and GetActualTheme
should always return either Light
or Dark
but never Default
, otherwise there is a bug. Anyway, what it returns doesn't matter much unless you're using more advanced features like defining/overriding theme resources at the element level.
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.
from modernwpf.
Thank you reaally much for your answer and support!!😊😊
from modernwpf.
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?
from modernwpf.
I think, that to make an acrylic effect, the best way is by using FluentWPF.
from modernwpf.
In theory, your code should work and
GetActualTheme
should always return eitherLight
orDark
but neverDefault
, otherwise there is a bug. Anyway, what it returns doesn't matter much unless you're using more advanced features like defining/overriding theme resources at the element level.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.
I'm still getting this issue, but at least, they do not conflict with themes.
from modernwpf.
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?
from modernwpf.
Yes, I believe so. Thanks for the reminder.
from modernwpf.
Related Issues (20)
- A modern-day working output of this Solution ?
- Isn't the latest version of NuGet on top?
- FontIcon 里的FontSize属性无效
- WindowsStyle = None, not working
- ResizeMode="CanMinimize" Has a bug
- Trying to build from source but getting: MSB3644 The reference assemblies for .NETFramework,Version=v4.5 were not found HOT 1
- DNS Resolution failure for schemas.modernwpf.com HOT 1
- No problem during building, but execution ModernWpf.SampleAPP failed
- Build fail
- checkbox border almost not visibile in 0.9.7 peview
- How to make DataGrid more compact HOT 1
- How to disable minimize button with "UseModernWindowStyle:true"
- Datagrid AlternatingRowBackground has priority
- When the program starts, an exception is triggered in the UpdateBrushes function .cs ColorsHelper HOT 1
- CommandBarFlyout sometimes disabled
- Allow dynamic MenuFlyout
- ui:CommandBar.SecondaryCommands with gesture text: too high
- Problem with style radiobutton, Cannot find resource named 'RadioButtonOuterEllipseFill'
- 创建了ModernWpf 开发交流群,希望作者大佬能允许和支持
- 这个项目还会继续更新吗 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modernwpf.