Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I am a beginner in MEF. According to my requirement I have to show the multiple plugin UI according to the selection of plugin. For that I have to pass plugin related data to the external plugin UserControl.

[InheritedExport(typeof(IConnect))]
public interface IConnect{}


Below code is using to initializing the external UI from the main application,

[ImportMany(typeof(IConnect))]
public IEnumerable<lazy><iconnect>> Plugins;
....
.....
var catalog = new DirectoryCatalog(@"C:\TestDll\");
var container = new CompositionContainer(catalog);
container.ComposeParts(this);

var childControl = SelectedPlugin as UserControl;
//Here I have to pass the required data to the usercontrol. How to do this?

Dockpanel.Children.Add(childControl );
Could you please suggest a way to pass data to the external user control
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900