/// <summary> /// Runs the bootstrapper sequence. /// </summary> public void Run() { var logger = LoggerFacade; if (logger == null) { throw new InvalidOperationException("LoggerFacade is null."); } logger.Log("Creating container.", Category.Debug, Priority.Low); Container = CreateContainer(); if (Container == null) { throw new InvalidOperationException("Container is null."); } logger.Log("Creating Caliburn container.", Category.Debug, Priority.Low); CaliburnContainer = CreateCaliburnContainer(); if (CaliburnContainer == null) { throw new InvalidOperationException("CaliburnContainer is null."); } logger.Log("Configuring Caliburn.", Category.Debug, Priority.Low); var core = CaliburnFramework.ConfigureCore(CaliburnContainer); ConfigureCaliburn(core); logger.Log("Registering services.", Category.Debug, Priority.Low); RegisterServices(); logger.Log("Initializing services.", Category.Debug, Priority.Low); InitializeServices(); logger.Log("Registering presenters.", Category.Debug, Priority.Low); RegisterPresenters(); logger.Log("Registering application views.", Category.Debug, Priority.Low); RegisterViews(); logger.Log("Final configuration before starting Caliburn.", Category.Debug, Priority.Low); BeforeStart(core); logger.Log("Starting Caliburn.", Category.Debug, Priority.Low); core.Start(); logger.Log("Finishing setting up the application.", Category.Debug, Priority.Low); AfterStart(); }
/// <summary> /// Initializes a new instance of the <see cref="App" /> class. /// </summary> /// <exception cref="T:System.InvalidOperationException"> /// More than one instance of the <see cref="T:System.Windows.Application" /> class is created per <see cref="T:System.AppDomain" />. /// </exception> public App() { var container = new SimpleContainer(); CaliburnFramework .ConfigureCore(container) .WithPresentationFramework() .Start(); // Note: register all application commands here container.RegisterSingleton <ClosePanelCommand>("ClosePanel"); container.RegisterSingleton <NavigateToCurrentNodeCommand>("NavigateToCurrentNode"); container.RegisterSingleton <NavigateToParentNodeCommand>("NavigateToParentNode"); container.RegisterSingleton <RefreshChildNodesCommand>("RefreshChildNodes"); container.RegisterSingleton <DublicateSelectedPanelCommand>("DublicateSelectedPanel"); container.RegisterSingleton <SwitchThemeCommand>("SwitchTheme"); container.RegisterSingleton <SwapStackContainerOrientationCommand>("SwapStackContainerOrientation"); container.RegisterSingleton <SplitTabContainerCommand>("SplitTabContainer"); container.RegisterSingleton <WrapPanelWithTabContainerCommand>("WrapPanelWithTabContainer"); container.RegisterSingleton <TogglePanelHeaderCommand>("TogglePanelHeader"); }
/// <summary> /// Initializes a new instance of the <see cref="CaliburnApplication"/> class. /// </summary> /// <exception cref="T:System.InvalidOperationException"> /// More than one instance of the <see cref="T:System.Windows.Application"/> class is created per <see cref="T:System.AppDomain"/>. /// </exception> public CaliburnApplication() { BeforeFrameworkInitialize(); UnhandledException += OnUnhandledException; Exit += OnExit; Startup += OnStartup; _container = CreateContainer(); var core = CaliburnFramework .ConfigureCore(_container, ConfigureCaliburn); core.WithAssemblies(SelectAssemblies()); var frameworkConfiguration = core.WithPresentationFramework(); ConfigurePresentationFramework(frameworkConfiguration); BeforeStart(core); core.Start(); }
/// <summary> /// Initializes a new instance of the <see cref="CaliburnApplication"/> class. /// </summary> /// <exception cref="T:System.InvalidOperationException"> /// More than one instance of the <see cref="T:System.Windows.Application"/> class is created per <see cref="T:System.AppDomain"/>. /// </exception> public CaliburnApplication() { //xBeforeFrameworkInitialize(); _container = CreateContainer(); //System.Threading.ThreadPool.QueueUserWorkItem(o => // { var core = CaliburnFramework.ConfigureCore(_container, ConfigureCaliburn); core.WithAssemblies(SelectAssemblies()); var frameworkConfiguration = core.WithPresentationFramework(); ConfigurePresentationFramework(frameworkConfiguration); BeforeStart(core); core.Start(); CoreStarted(); // }); }