public void OnInitialized(IContainerProvider containerProvider) { IEventAggregator eventAggregator = containerProvider.Resolve <IEventAggregator>(); // Note splash page eventAggregator.GetEvent <SplashMessageUpdateEvent>() .Publish(new SplashMessageUpdateEvent { Message = "Loading TextDocument Module" }); //Register a default file opener IContentHandlerRegistry registry = containerProvider.Resolve <IContentHandlerRegistry>(); registry.Register(containerProvider.Resolve <AllFileHandler>()); }
public void Initialize() { LoadCommands(); LoadMenus(); LoadToolbar(); IWorkspace workspace = VEFModule.UnityContainer.Resolve(typeof(AbstractWorkspace), "") as AbstractWorkspace; VEFModule.UnityContainer.RegisterType <VEXProjectHandler>(); VEFModule.UnityContainer.RegisterType <VEXProjectViewModel>(); VEFModule.UnityContainer.RegisterType <VEXProjectView>(); IContentHandler handler = VEFModule.UnityContainer.Resolve(typeof(VEXProjectHandler), "") as VEXProjectHandler; IContentHandlerRegistry chr = VEFModule.UnityContainer.Resolve(typeof(IContentHandlerRegistry), "") as IContentHandlerRegistry; chr.Register(handler); //SceneManager and scenegraph needs socketserver! VEFModule.UnityContainer.RegisterType <ISocketServerService, SocketServerManager>(new ContainerControlledLifetimeManager()); VEFModule.UnityContainer.RegisterType <SocketServerToolViewModel>(new ContainerControlledLifetimeManager()); var tvm = VEFModule.UnityContainer.Resolve(typeof(SocketServerToolViewModel), "") as SocketServerToolViewModel; tvm.IsVisible = false; workspace.Tools.Add(tvm); ToolViewModel propertiesView = workspace.Tools.First(f => f.ContentId == "SocketServer"); propertiesView.IsVisible = true; var _SocketServerManager = VEFModule.UnityContainer.Resolve(typeof(SocketServerManager), "") as SocketServerManager; _SocketServerManager.SocketServerToolModel = tvm.Model as SocketServerToolModel; VEFModule.UnityContainer.RegisterType <FileWatcherHandler>(); VEFModule.UnityContainer.RegisterType <FileWatcherViewModel>(); VEFModule.UnityContainer.RegisterType <FileWatcherView>(); IContentHandler fileWatcherHandler = VEFModule.UnityContainer.Resolve(typeof(FileWatcherHandler), "") as FileWatcherHandler; chr.Register(fileWatcherHandler); //VEFModule.UnityContainer.RegisterType<IFileWatcherService, FileWatcherManager>(new ContainerControlledLifetimeManager()); //VEFModule.UnityContainer.RegisterType<FileWatcherViewModel>(new ContainerControlledLifetimeManager()); //var fw_tvm = VEFModule.UnityContainer.Resolve(typeof(FileWatcherViewModel), "") as FileWatcherViewModel; //fw_tvm.IsVisible = false; //workspace.Tools.Add(fw_tvm); //ToolViewModel fwView = workspace.Tools.First(f => f.ContentId == "FileWatcher"); //fwView.IsVisible = true; //var _FileWatcherManager = VEFModule.UnityContainer.Resolve(typeof(FileWatcherManager), "") as FileWatcherManager; //_FileWatcherManager.FileWatcherToolModel = fw_tvm.Model as FileWatcherToolModel; //------------------------------------------------------ // REgister SceneService //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <ISceneService, SceneManager>(new ContainerControlledLifetimeManager()); //------------------------------------------------------ //Register File Type //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <SceneViewerHandler>(); VEFModule.UnityContainer.RegisterType <SceneViewModel>(); VEFModule.UnityContainer.RegisterType <SceneView>(); IContentHandler sceneViewerhandler = VEFModule.UnityContainer.Resolve(typeof(SceneViewerHandler), "") as SceneViewerHandler; chr.Register(sceneViewerhandler); VEFModule.UnityContainer.RegisterType <SceneGraphToolViewModel>(); // _container.RegisterType<SceneToolView>(); var sgtvm = VEFModule.UnityContainer.Resolve(typeof(SceneGraphToolViewModel), "") as SceneGraphToolViewModel; sgtvm.IsVisible = true; workspace.Tools.Add(sgtvm); ToolViewModel sceneGraphView = workspace.Tools.First(f => f.ContentId == "SceneGraph"); sceneGraphView.IsVisible = true; //------------------------------------------------------ // REgister AtlasService //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <IAtlasService, AtlasManager>(new ContainerControlledLifetimeManager()); //------------------------------------------------------ //Register File Type //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <AtlasHandler>(); VEFModule.UnityContainer.RegisterType <AtlasViewModel>(); VEFModule.UnityContainer.RegisterType <AtlasView>(); IContentHandler AtlasViewerhandler = VEFModule.UnityContainer.Resolve(typeof(AtlasHandler), "") as AtlasHandler; chr.Register(AtlasViewerhandler); //VEFModule.UnityContainer.RegisterType<AtlasGraphToolViewModel>(); //// _container.RegisterType<AtlasToolView>(); //var sgtvm = VEFModule.UnityContainer.Resolve(typeof(AtlasGraphToolViewModel), "") as AtlasGraphToolViewModel; //sgtvm.IsVisible = true; //workspace.Tools.Add(sgtvm); //------------------------------------------------------ // REgister AtlasService //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <IAnimationEditorService, AnimationEditorManager>(new ContainerControlledLifetimeManager()); //------------------------------------------------------ //Register File Type //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <AnimationEditorHandler>(); VEFModule.UnityContainer.RegisterType <AnimationEditorViewModel>(); VEFModule.UnityContainer.RegisterType <AnimationEditorView>(); IContentHandler AnimationEditorViewerhandler = VEFModule.UnityContainer.Resolve(typeof(AnimationEditorHandler), "") as AnimationEditorHandler; chr.Register(AnimationEditorViewerhandler); //------------------------------------------------------ // Register DatabaseManager //------------------------------------------------------ VEFModule.UnityContainer.RegisterType <IDatabaseService, DatabaseManager>(new ContainerControlledLifetimeManager()); LoadSettings(); RegisterDatabase(); SetDatabaseContext(); var shell = VEFModule.UnityContainer.Resolve(typeof(ShellViewMetro), "shell") as ShellViewMetro; shell.LoadLayout(); //load avalondock layout (shell as Window).Show(); }