Reputation: 2487
Although I've found a lot of "pack uri issue" questions, I didn't get an answer for my problem.
I have a prism solution where I want a MyApplication.Resources
assembly hold all my application wide styles and templates.
So
Step 7: loading the Generic.xaml in my module view (type: Microsoft.Windows.Controls.Ribbon.RibbonTab
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MyApplication.Resources;component/Themes/Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
I've also tried the absolute variant with
<ResourceDictionary Source="pack://application:,,,/ElairoCRM.Resources;component/Themes/Generic.xaml"/>
All steps above are verified with the MSDN doku to pack uri and a lot of stackoverflow questions and wpf resource tutorials in the internet.
But nothing works. Did I miss something?
Thank you in advance.
Edit: I've forgot the error that occured:
XamlParseException with inner exception FileNotFoundException having the message: The file or assembly \"MyApplication.Resources, culture=neutral" or one of its dependencies, was not found.
Upvotes: 1
Views: 2592
Reputation: 2487
I've resolved the problem by myself. I copied the Generic.xaml file in the Resource assembly from the themes folder to the assembly root and changed the pack argument to component/Generic.xaml. Everything works now as expected. I've found no documentation about this behaviour.
Upvotes: 0