in my application, i have a resource dictionary defined as a separate file. Now i want to access this dictionary from a c#-file (no code-behind file!)
What would be the best(fastest, cleanest) way to do this?
-
Create a ResourceDictionary in code and merge it with the existing one?
-
Add the ResourceDictionary to the application’s resources and access
them with Application.Current.Resources? - Some other way??
Greets,
Jürgen
You can load resource dictionaries using App.LoadComponent(), e.g.:
Not really sure if it would be the fastest, but it is probably one of the cleaner ways.