I cannot verify this at this time, but I hope it works.
Instead of the root path, use the relative path in Project 2, i.e.
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Components/Type/CheckBox.xaml"/> </ResourceDictionary.MergedDictionaries>
You can also use .. to navigate to the relative directory (depending on the location of CommonStyle.xaml ), for example
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../Components/Type/CheckBox.xaml"/> </ResourceDictionary.MergedDictionaries>
I believe that when you use the root path (starting with / ), it will look for CheckBox.xaml in the root of the project where you use CommonStyle.xaml , and not relative to the location of CommonStyle.xaml .
Additional explanation
From your description, it looks like you have the following structure:
- Project 1 - Window.xaml - Project 2 - CommonStyle.xaml - Components - Type - CheckBox.xaml
When CommonStyle.xaml refers to / , it usually refers to the root of project 2, however when you merge it into Window.xaml , / will now refer to the root of project 1, then it will not be able to find Components/Type/CheckBox.xaml .
By removing / , he will now look for Components/Type/CheckBox.xaml relative to the location of CommonStyle.xaml that he can do.
source share