Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Composing inter-dependant objects

$
0
0
Hi there,

I'm trying to introduce MEF and nHibernate into a legacy windows forms application. I've currently got a factory which exports nHibernates' ISession interface and I'm trying to work out how to get a single instantiation injected into a form AND it's custom controls.

E.g. I have a custom search control that is used on many forms. I've added an ISession import as a property (as ImportingConstructor will break the windows forms designer). This custom search control is part of a form that also has a ISession on it's ImportingConstructor. How can I get the same instance of ISession that is used to compose the form, also into the custom control?

Or am I barking up the wrong tree with the direction I'm taking?

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>