1
votes

I have a WPF assembly, besides exe file, a have a folder "Component", where the user can put custom DLL with components. These DLL files consist of ViewModels and Resource Dictionaries(where data templates for viewmodels are described). These DLL assemblies are loaded by reflection.

Question: how I can dynamically load all dictionaries from these assemblies to my App.xaml?

1

1 Answers

0
votes

When you load these assemblies I'm guessing you also load a main component, something crucial for it to work, like a module.

You can have all you modules implement an interface with a GetResourceDictionaries method that you call from the application when intintializing. Then have all gathered ResourceDictionaries added to your Application.Resources.