Get a reference to a service collection?

Topics: Web Client Software Factory, UIP Application Block discussion, User Forum
Jul 17, 2007 at 3:48 PM
Edited Jul 17, 2007 at 3:49 PM
Inside of my presenter I would like to pull a service from the root module's service collection. I know I can do this using contructor or property injection but the service will be used rarely in my presenter and I don't want to load it every time. I've looked at a couple things but can't quite find a clean way to get to it. This seems like it should be easy?!

If I can't get to the services collection directly is there a way to get to either the root container or my module's conatiner from my presenter?
Jul 17, 2007 at 4:27 PM
Yeah it was easy. I just added
ServiceDependency Microsoft.Practices.CompositeWeb.Interfaces.ICompositionContainer compContainer
to my presenter and from the container it's easy to get to the services.

Is there a cleaner way to do this?