question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on ThemeManager.Current.DetectTheme

See original GitHub issue

When 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 image

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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
batzencommented, Apr 25, 2020

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

0reactions
Luk164commented, May 25, 2020

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found