Compose() private method

private Compose ( ) : void
return void
Exemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            // Ensure the current culture passed into bindings is the OS culture.
            // By default, WPF uses en-US as the culture, regardless of the system settings.
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            DispatcherUnhandledException += OnDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += OnCurrentDomainUnhandledException;

            Current.Exit += OnApplicationExit;

            var compositionRoot = new CompositionRoot();
            compositionRoot.Compose(this);
            this.logger = compositionRoot.Logger;

            this.logger.LogAlways(() => "=========== Budget Analyser Starting ===========");
            this.logger.LogAlways(() => compositionRoot.ShellController.DashboardController.VersionString);
            var initialisableShell = compositionRoot.ShellController as IInitializableController;
            if (initialisableShell != null)
            {
                initialisableShell.Initialize();
            }

            compositionRoot.ShellWindow.DataContext = compositionRoot.ShellController;
            this.logger.LogInfo(() => "Initialisation finished.");
            compositionRoot.ShellWindow.Show();
        }