.NET Framework Bookmark and Share   
 index > Managed Extensibility Framework > Do MEF support WPF elements composition?
 

Do MEF support WPF elements composition?

Hi,


I discovered MEF one hour ago and it seems that this Framework interest me a lot to program a plugin based application.
However, I have some questions about it and I will be really glad if someone, who knows MEF, give me some answers.

1- Do each Plugin or Part can be configurable independently ? I mean, is it possible to associate an "App.Config" file for each Plugin so that each one can be configurable independently ?
2- Do MEF allow WPF controls composition ? Suppose I have a plugin A and a plugin B. In each one I have a WPF component, a Panel in the plugin A and a Button in plugin B. I'd like to know if my Button in the plugin B can be added to my Panel in plugin A. In fact, I'd like to reproduce the Composite Application Library behavior with MEF. Is that possible?

Thanks

Riana
Riana Rambonimanana
After taking a look more closely, it seems that my question number 2 is satisfiable and, the sample codes use it. It is totally possible to declare Shell container and use MEF to insert Chidren to the shell container.

About my question number 1, it seems that it is not possible unfortunately ...
The all application is always executed in the default app domain so, only one configuration file can be used for all classes and components of the application.
It seems that it is not possible to have some kind of configurable "Modules". I mean by "Modules" an aggregation of classes or assemblys that are logically tied together. Each Module should be configurable with one configuration file, and can interact with other Modules of the application. Also, a module should be dynamically loadable and unloadable...

Imagine for example an application which can be composed by a 'Communication Module' that should be configurable with an App.config file because it use WCF client, and a "UI Module" that should also have its own configuration file. It seems that this scenario is not possible to realize using MEF ...

Please tell me if I am right or wrong.

Regards,

Riana




Riana Rambonimanana
I think you might need MAF (System.Addin namespace) rather than MEF in your situation; MAF load the assembly or add-ins in different App-Domain and you can let your "Modules" have different configuration file.


Regards,
cautionsign.
+_cautionsign+_
cautionsign

You can use google to search for other answers

Custom Search

More Threads

• Firing Tab Changed Events for a TabbedWorkspace
• No "hard dependancy" but a new dependancy is introduced.
• MEF Component Composition designer
• MEF and singletons
• MEF for server side applications
• Why multi ExportAttribute is not supportted by property?
• Generics in Unity
• Comparison to the AddIn libraries?
• Looking for example of some usercontrol/tabitem exporting a ToolBar object
• Advice on Using .Net frame work with Open Xml for excel automation