MaterialDesignInXAML / MaterialDesignInXamlToolkit

Google's Material Design in XAML & WPF, for C# & VB.Net.
http://materialdesigninxaml.net
MIT License
15.04k stars 3.41k forks source link

MahApps Flyout - Error locating resource pack #1012

Closed svjansen closed 5 years ago

svjansen commented 6 years ago

I was just looking into MahApps in combination with materialdesign and worked down the guide. However I can't get it running it. I've just copied the App.xaml from guide and got an error on <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" /> the <ResourceDictionary><ResourceDictionary.MergedDictionaries> is there of course just hidden behind the tooltip. resourcerror

Error locating resource pack://application:,,,/MaterialDesignThemes.MahApps;Component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml (google translator :D)

I got the following packages installed

packages

Anything I'm missing here?

jiewei915 commented 6 years ago

yes,the same problem. I compare with the example,only difference is the version of MaterialDesignTheme.MahApps.dll. Maybe in the new version,there is no need to import the Flyout.xaml dictionary.

Keboo commented 6 years ago

I suspect the issue here is a mismatch in versions. The MaterialDesignThemes.MahApps nuget is expecting to target MahApps 1.2. (though the nuget doesn't restrict it to that version). There are known issues with the latest MahApps nuget (1.6.). These have been addressed on the master branch and will be released as part of the 2.5.0 (upcoming) release; however there are not any nuget packages that have been released for this yet. The guide that you referenced above is out dated and will need to be updated for the latest 2.5.0 work that is coming.

So a few possible solutions (though none are ideal atm)

  1. Downgrade your MahApps.Metro to 1.2.*
  2. Compile the latest MaterialDesignThemes.MahApps project from the master branch and manually reference it.
svjansen commented 6 years ago

I've found an another issue around where somebody suggested the MahApps.163 nuget that fixed my problem for now. However thanks for the answer.

My current nuget setup look like the following which is working without any problem.

new_nuget

Keboo commented 5 years ago

This should be fixed with the latest 2.5.0 release. Let me know if there are still issues.