Error on ThemeManager.Current.DetectTheme
See original GitHub issueWhen running the following line:
ControlzEx.Theming.ThemeManager.Current.DetectTheme(Application.Current.MainWindow);
I get the Following error:
System.ArgumentException: ‘Resource key “Theme.PrimaryAccentColor” is missing, is null or is not a color.’
See a simple example in my GitHub repo" https://github.com/mauricio-bv/MahappsIssue.git
Screenshots
Environment:
- MahApps.Metro version [2.0.0-Alpah0748] via Nugets
- OS: [e.g. Win10 1909]
- Visual Studio 2019 16.5.4
- .NET Core 3.1
Additional context This does not happen when running from the source code (latest commit in Git)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
mahapps.metro.ThemeManager.DetectTheme give me a ...
MahApps is a WPF metro inspired library, and one of it's functions allows the user to get the current theme that is being...
Read more >Dynamically change theme and accent of a GUI with MahApps 2
The ThemeManager class contains a Current method, allowing you to detect current informations. We will then add our previous methods to this one ......
Read more >Thememanager
Thememanager. MahApps.Metro has a ThemeManager class that lets you change the theme using code-behind. It can be done in 1 line, like so:...
Read more >MahApps
Describe the bug. I have a standard MVVM setup for dialogs. XAML: <controls:MetroWindow [...] xmlns:Dialog="clr ...
Read more >XPence: A WPF Metro Style, Smart Client Expense Tracker
This blog helped me overcome a WPF bug that bugged me for a while. ... DetectTheme(Application. ... Current); var accent = ThemeManager.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The version of MahApps.Metro supporting the current ThemeManager implementation from ControlzEx is not released to nuget yet. You can use the nuget feed from the appveyor CI system to get the latest preview versions. The appveyor nuget feed is https://ci.appveyor.com/nuget/mahapps.metro
Ok I managed to fix it by downloading the latest tamplate and comparing changes. Thats what I get for using a tool in beta I guess…