Pages

Monday, June 7, 2010

Pluggable Resource for WPF ResourceDictionary using Reflection

Plugins are the external dlls or modules that runs on an application without having strong relationship with it. Means you can easily uninstall a plugin by just deleting the specified files related to the plugin without affecting the whole application. In .NET technology we have a concept of Assemblies. You can reference an assembly when you want the assembly to be totally dependent on the other one. These are called Dependent assemblies. Plugins do not have direct reference while it is being referenced directly from a specific folder, so that the necessary plugins could be added dynamically to the application. In this article I am going to discuss how we can create plugins to load Themes, styles, Languages, and Objects.

Introduction


As we go ahead with WPF, there are lots of problems we face which are such basic but with lots of importance. In my last application with WPF, I found that it is very essential to build a solid foundation to Styles and Themes which we can use in our application. While we build our application, we create resources. Some of them we place in resource dictionary while others in the window itself. Thus when we finally release our code, we find that changing the theme is to be a huge task altogether. In this article I will discuss, the steps how you can easily manipulate styles by placing the ResourceDictionary objects into another library and use .NET Reflection to plugin the Resource directly into your application.





To read the Full Article please visit:
Pluggable Styles & Resources in WPF

I  hope you will like this article too. Thank you for reading

1 comment:

Please make sure that the question you ask is somehow related to the post you choose. Otherwise you post your general question in Forum section.