I have two projects in my solution. The first project is a WPF application, the other is a regular DLL project. Inside the DLL project I have some WPF user controls. I want these controls to share some resources and define them in the DLL.
I know that in a regular WPF application, you can specify application resources in App.xaml. Is there an equivalent in a DLL project?
No, there isn’t an equivalent in a dll, because the resource loading isn’t part of an assembly (exe), but part of an application. In order to load resources an application must be loaded. App is the root element of an application, rather than an exe assembly. To do the equivalent for controls in a dll you can create a separate ResourceDictionary and add it to each control’s XAML by merging it into the UserControl’s resources using ResourceDictionary.MergedDictionaries.