wpf - Does Caliburn provide a way to get a reference to the container from anywhere? -


I am currently roaming with Rob Eisenberg's Caliber framework. An example of how the caliber service should be resolved from the container, but given the available documentation.

This is something on the lines of this:

  SimpleContainer Container = New Simple Container (); CaliburnFramework .ConfigureCore (Container) with .commonDialogs () .with Display Framework () Start (); Var service = container.gate instance (type (IService)) as a service;  

However, whatever I remember, there is a way to get the container reference anywhere in the app. By this way:

  var service = caliber. Container.Get Instance (typewise (ISWARE)) service;  

Do I have to build a custom static class that holds in the context of the container or is it already built in the caliber?

Thank you and thank you in advance!

itemprop = "text">

Caliburn's latest trunk version automatically registers the container on the framework startup as a service locator. You just have to refer to the reference Microsoft.Practices.ServiceLocation on your code and then ask for ServiceLocator for your service example.

  var service = servitium Present. Get Instance & lt; IService & gt; ();  

Hope that helps.


Comments