GithubHelp home page GithubHelp logo

Comments (9)

Kinnara avatar Kinnara commented on May 22, 2024 2

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.

image

from modernwpf.

denik7770 avatar denik7770 commented on May 22, 2024

sssss
As you see, a theme is not actually light.

from modernwpf.

Kinnara avatar Kinnara commented on May 22, 2024

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.

image

from modernwpf.

denik7770 avatar denik7770 commented on May 22, 2024

Thank you reaally much for your answer and support!!😊😊

from modernwpf.

ashelleyPurdue avatar ashelleyPurdue commented on May 22, 2024

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.

denik7770 avatar denik7770 commented on May 22, 2024

I think, that to make an acrylic effect, the best way is by using FluentWPF.

from modernwpf.

denik7770 avatar denik7770 commented on May 22, 2024

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.

image

I'm still getting this issue, but at least, they do not conflict with themes.
Untitleaad

from modernwpf.

ShankarBUS avatar ShankarBUS commented on May 22, 2024

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.

Kinnara avatar Kinnara commented on May 22, 2024

Yes, I believe so. Thanks for the reminder.

from modernwpf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.