I could never get this resource dictionary link format to work. What am I missing.
Scenario:
Create and build with some user controls.
The root file is {root} /Themes/ColorThemes.xaml
The ColorThemes.xaml file has an assembly action set to Resource .
Then in the xaml file further down say {root} /Controls/ButtonStyles/Themes/ButtonThemes.xaml (note that the path is just an example) in this file I have the following code bit:
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/Themes/ColorThemes.xaml"/> </ResourceDictionary.MergedDictionaries>
As for the documentation , this should work (as I understand it), but while I am in the designer, everything seems to be in order (all colors are loaded, etc.), however, when I go to compile my application and run it, I I get this error {"Unable to find resource 'themes / colorthemes.xaml'. "}, which is strange because it seemed to be used very well in the builder. Therefore, I am confused because it does not match the documentation.
Therefore, if someone can explain to me what I am missing :)
Note: if I changed the previous code to
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../../../Themes/ColorThemes.xaml"/> </ResourceDictionary.MergedDictionaries>
It works fine, however for cleanese pack: // application :.
source share