Service Index

Core Services

IServiceLocator

The Caliburn framework is composed of a variety of services that work in tandem to simplify UI development. As a result of this componentization, Caliburn itself is dependent on service location to find various implementations of its services and use them. Out of the box, Caliburn configures a SimpleContainer for this purpose. However, you can supply your own container. To make this process easier, Caliburn provides implementations for Windsor(Caliburn.Windsor), StructureMap(Caliburn.StructureMap), Spring.NET(Caliburn.Spring), Unity(Caliburn.Unity), Ninject(Caliburn.Ninject), MEF(Caliburn.MEF) and Autofac(Caliburn.Autofac) out of the box. More details on the common service locator can be found here.

IConfigurator

In addition to service location, Caliburn must be able to configure its services. To enable this, we layer IConfigurator on top of IServiceLocator. All provided adapters implement this interface as well.

IThreadPool

Any operation in Caliburn that create background processes uses the IThreadPool to queue work. The default implementation is called DefaultThreadPool and uses ThreadPool.QueueUserWorkItem under the covers.

IMethodFactory

The IMethodFactory creates instances of IMethod which can be used to loosely invoke a method either on the current thread or on a background thread. The default implementation is called MethodFactory and it uses the DelegateFactory which creates Expression trees under the covers to optimize invocation and avoid repeated reflection.

IEventHandlerFactory

The IEventHandlerFactory creates instances of IEventHandler. It is used to loosely wire events. The default implementation is called EventHandlerFactory.

IDispatcher

IDispatcher abstracts the WPF/Silverlight dispatcher and adds some additional facilities. There are two implementations DispatcherImplementation and BatchingDispatcher. More details can be found here.

IAssemblySource

From time to time Caliburn needs to inspect assemblies and locate various types. Examples of this include during auto-registration of components, location of Views, etc. The IAssemblySource lets developers specify which assemblies should be inspected. The default implementation is called DefaultAssemblySource. Interested parties can also be notified when new assemblies are added to the IAssemblySource by handling the AssemblyAdded event.

Presentation Framework

IRoutedMessageController

The IRoutedMessageController is a key player in Caliburn's routed message mechanism. You can use it to register message triggers and handlers. Thus, it greatly affects how Actions and Commands work. It can also be used to traverse the IInteractionNode hierarchy and to setup interaction defaults for controls. The default implementation is called RoutedMessageController. The attached properties Message.Triggers and Message.Attach both use this service under the covers.

IMessageBinder

When messages are sent, the IMessageBinder is used to bind parameters and outcomes in and out of the message. This is what gives Action signatures such flexibility. The default implementation is called MessageBinder.

IParser

When using Message.Attach, the attached property uses the IParser under the covers to convert the text into a collection of IMessageTrigger instances. Besides replacing the parser entirely, you can also extend it by registering additional ITriggerParsers and IMessageParsers.

IActionFactory

When setting Action.Target, the IActionFactory comes into play. This attached property creates an instance of ActionMessageHandler and initializes it with an IActionHost. The target is passed along with an IActionFactory which is responsible for inspecting the target and creating instances of IAction. The ActionMessageHandler will then use its collection of IActions to handle any messages that it is asked to process by the routed messaging mechanism. Various aspects of IActionFactory can be overriden in order to easily change to process of action discovery.

IViewStrategy

When using the View.Model attached property, Caliburn uses the IViewStrategy to locate an appropriate view for the provided model. The DefaultViewStrategy does this by using a series of namespace conventions. More information can be found here.

IBinder

IBinder plays an important part in the View.Model attached property lifecycle. When this property is set, after a view is located using the IViewStrategy, the IBinder "connects" the View and the ViewModel. More details can be found here.

IStateManager

Caliburn supplies various implementations of IStateManager for the purpose of persisting simple key/value pairs. You can read more about it here.

IWindowManager (WPF Only)

This service is used to open windows and modal dialogs. It is used by CaliburnApplication to open the main window at startup. It support a model-first approach to handling windows/modals and makes use of IViewStrategy and IBinder to get its work done.

Last edited Oct 23, 2009 at 7:55 PM by EisenbergEffect, version 19