Skip to content
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

Change Theme dynamically #3749

Open
ShehabFekry opened this issue Dec 24, 2024 · 0 comments
Open

Change Theme dynamically #3749

ShehabFekry opened this issue Dec 24, 2024 · 0 comments
Labels
bug evaluation required Items is pending review or evaluation by the team

Comments

@ShehabFekry
Copy link

ShehabFekry commented Dec 24, 2024

Bug explanation

I have a resource dictionary with this values assigned

<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" /> <materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="LightBlue" SecondaryColor="LightBlue" /> </ResourceDictionary.MergedDictionaries>

I want to create a toggle button to change the value of the BaseTheme and primary and secondary colors using MVVM i binded the toggle to a method as shown below

               var pallete = new PaletteHelper();
               var theme = pallete.GetTheme();

when i try to get the theme i get this exception

System.InvalidOperationException: Could not locate required resource with key(s) 'MaterialDesign.Brush.Primary.Light

My project is a class library Revit plugin with some WPF views I don't have an App.xaml file

Version

5.1

@ShehabFekry ShehabFekry added bug evaluation required Items is pending review or evaluation by the team labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug evaluation required Items is pending review or evaluation by the team
Projects
None yet
Development

No branches or pull requests

1 participant