/// <summary> /// Initializes the core. /// </summary> /// <param name="serviceLocator">The service locator.</param> public override void Initialize(IServiceLocator serviceLocator) { Execute.Initialize(serviceLocator.GetInstance <IDispatcher>()); base.Initialize(serviceLocator); var controller = serviceLocator.GetInstance <IRoutedMessageController>(); var messageBinder = serviceLocator.GetInstance <IMessageBinder>(); var parser = serviceLocator.GetInstance <IParser>(); var conventionManager = serviceLocator.GetInstance <IConventionManager>(); var viewModelBinder = serviceLocator.GetInstance <IViewModelBinder>(); var viewModelDescriptionFactory = serviceLocator.GetInstance <IViewModelDescriptionFactory>(); parser.RegisterMessageParser("Action", new ActionMessageParser(conventionManager, messageBinder)); parser.RegisterMessageParser("ResourceCommand", new CommandMessageParser(conventionManager, messageBinder, CommandSource.Resource)); parser.RegisterMessageParser("ContainerCommand", new CommandMessageParser(conventionManager, messageBinder, CommandSource.Container)); parser.RegisterMessageParser("BoundCommand", new CommandMessageParser(conventionManager, messageBinder, CommandSource.Bound)); Message.Initialize( controller, parser ); Action.Initialize( controller, viewModelDescriptionFactory, serviceLocator ); View.Initialize( serviceLocator.GetInstance <IViewLocator>(), viewModelBinder ); ScreenExtensions.Initialize( serviceLocator.GetInstance <IViewModelFactory>() ); ViewConventionBase.Initialize( messageBinder, viewModelDescriptionFactory, serviceLocator.GetInstance <IValidator>() ); Bind.Initialize(viewModelBinder); Coroutine.Initialize( serviceLocator, serviceLocator.GetInstance <IBuilder>(), parentEnumeratorFactory ); if (!registerItemsWithSubjects) { return; } var registry = serviceLocator.GetInstance <IRegistry>(); var assemblySource = serviceLocator.GetInstance <IAssemblySource>(); assemblySource.Apply(x => RegisterItemsWithSubjects(registry, x)); assemblySource.AssemblyAdded += assembly => RegisterItemsWithSubjects(registry, assembly); }