I have a solution with two WPF projects: Primary and Secondary.
In the Primary project, a Window named PrimaryView instantiates an UserControl called SecondaryControl, defined in Secondary project.
SecondaryControl uses SecondaryStyle, which is defined in SecondaryResourceDictionary (as you might have guessed already, defined in SecondaryProject).
The fact is: when I try to run the solution, I get a XamlParseError
, and digging InnerExceptions I eventually find the culprit, the ResourceNotFound
error.
So my questions are:
If SecondaryControl and its SecondaryStyle are defined in the same assembly, why can't I instantiate it it PrimaryAssembly?
Should I make SecondaryStyle available to PrimaryProject namespace somehow? Why?
I try to help you by explanation how it works in my projects. A separate assembly contains a common control and common resource dictionary like this:
CommonResources.xaml
SomeCommonControl.xaml
I can use this control and resources from another assemblies and WPF-projects like this:
I hope this will help you.