Ejemplo n.º 1
0
        /// <summary>
        /// Initializes static data.
        /// </summary>
        static DesignerHelper()
        {
            if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                var builder = new ContainerBuilder();

                builder.RegisterModule <LocatorModule>();
                builder.RegisterModule <CoreModule>();
                builder.RegisterModule <DependenciesModule>();
                builder.RegisterModule <AppModule>();
                builder.RegisterModule <ViewModule>();

                var container = builder.Build();

                ProjectEditorCommands.Initialize(container.Resolve <IServiceProvider>());
                InitializeContext(container.Resolve <IServiceProvider>());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="Application.Startup"/> event.
        /// </summary>
        /// <param name="e">A <see cref="StartupEventArgs"/> that contains the event data.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var builder = new ContainerBuilder();

            builder.RegisterModule <LocatorModule>();
            builder.RegisterModule <CoreModule>();
            builder.RegisterModule <DependenciesModule>();
            builder.RegisterModule <AppModule>();
            builder.RegisterModule <ViewModule>();

            using (var container = builder.Build())
            {
                using (var log = container.Resolve <ILog>())
                {
                    ProjectEditorCommands.Initialize(container.Resolve <IServiceProvider>());
                    Start(container.Resolve <IServiceProvider>());
                }
            }
        }