I need some help with Resource Dictionaries in WPF. I have multiple .dll's and in each dll are one or more Resource Dictionaries. The problem is I dont know the name or the location from the Resource Dictionaries in the DLL. Now Im looking for a way to add all these Resource Dictionaries in the Code Behind in my Main.xaml
Maybe something with reflection in the assembly?
ResourceDictionary resourceDictionary = new ResourceDictionary(); resourceDictionary.Source = new Uri("Dictionary1.xaml", UriKind.Relative); ResourceDictionary resourceDictionary2 = new ResourceDictionary(); resourceDictionary.Source = new Uri("Dictionary2.xaml", UriKind.Relative); resourceDictionary2.MergedDictionaries.Add(resourceDictionary); Resources.MergedDictionaries.Add(resourceDictionary2); But it only add 1 Resource Dictionary... Can you help me?