public MainWindow() { InitializeComponent(); var eventBroker = new EventBroker(); var messageRepository = new FileMessageProvider(); Type[] events = { typeof(MessageNofiticationEvent), typeof(VisualNotificationEvent) }; var eventAgent = new EventAgent(); foreach (var eventType in events) { eventAgent.Register(eventType); } var debugTracking = new DebugTrackingParticipant(); var agent = new MessageAgent(); IPrototype[] messages = { new MessageInfo(messageRepository), new PowerSupplayVisualComponent(eventBroker,agent, eventAgent), new MessageError(messageRepository, eventBroker), }; foreach (var message in messages) { agent.RegisterPrototype(message); } RegisterComponentTemplate(messages); var workflowProvide = new WorkflowProvider(SynchronizationContext.Current, eventBroker, debugTracking, agent, eventAgent); var model = new WorkflowRunner(workflowProvide, eventBroker); var componentViewCollection = new ComponentViewCollection(); var userNotificationView = new UserNotificationView(); var view = new EnableViewModel(model, componentViewCollection, userNotificationView, eventBroker); eventBroker.Register(componentViewCollection); eventBroker.Register(userNotificationView); eventBroker.Register(view); eventBroker.Register(model); // ioc for each IStartable.Start() //this.Closing += view.ViewClosing; //this.Closed += view.ViewClosed; DataContext = view; }