Monday, March 7, 2011

How to allow plugins to have custom properties?

Hi

I have wpf app and I am allowing usercontrol plugins that implement an interface.

i want to allow the plugins to have their own properties but I want to have these properties access from menu in the host.

How would this be architected best?

The properties could be string, double etc.

Malcolm

From stackoverflow
  • One simple solution is to use an Attribute on the custom properties and get them by reflection from the host.

  • Or you could pass in the menu to the plugin (when initialising it as part of the IPlugin interface) and it could populate the entries in the menu itself.

0 comments:

Post a Comment