WinUI - Using ResourceDictionary from a DLL in MergedDictionary

kijato 6 Reputation points
2021-03-26T10:55:57.18+00:00

I have this requirement where I need to access a resource dictionary defined in a DLL in my project as a merged dictionary. The whole project is setup as a C++/WinRT xaml hosted MFC application. And the required ResourceDictionary is a part of another dll.

<ResourceDictionary.MergedDictionaries> 
<ResourceDictionary Source="/CommonDictionary.xaml"/>
 </ResourceDictionary.MergedDictionaries>

As shown here in the Source property, CommonDictionary.xaml exists as part of another projects binary(dll) and I need to merge that file to my project by specifying the a path to it.
I've already tried something like this;

`<ResourceDictionary Source="pack://application:,,,/myNameSpace;component/CommonDictionary.xaml"/>` 

This didn't work in WinUI. Any help would be much appreciated.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
24,012 questions
1 vote