Coder Social home page Coder Social logo

Comments (2)

benruehl avatar benruehl commented on August 15, 2024

I looked at your repository and found the issue.

In your App.xaml you have the following:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Light.xaml" />
    <ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Dark.xaml" />
    <ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml" />
    <ResourceDictionary Source="/DataTemplates/ContentTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>

Change this to:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml" />
    <ResourceDictionary Source="/DataTemplates/ContentTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>

... and you're done.

Explanation

The way the color schemes work is that they both define colors and brushes with identical x:Key values. Each style e.g. for the menu items references the colors using those keys. When you switch the color scheme, the colors of the old scheme are removed and the colors of the new scheme are added instead. You should always include only one color scheme file. If you include both, the latter overwrites the former.

In your app this is not visible at first because you call ChangeTheme() on startup which calls ResourceLocator.SetColorScheme(). If you look at this method you can see that it searches for the first occurence of one of those color scheme files in you App.Resources in order to replace it with the other one. But because you included both files at the same time one remains in the resources and overrides the other.

from adonis-ui.

maximilien-noal avatar maximilien-noal commented on August 15, 2024

Ah, I get it. That fixed it !
Thank you for your great explanation. :)

from adonis-ui.

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.