public ApplicationController(IEnvironmentService environmentService, IPresentationService presentationService, ShellService shellService, Lazy<FileController> fileController, Lazy<RichTextDocumentController> richTextDocumentController, Lazy<PrintController> printController, Lazy<ShellViewModel> shellViewModel, Lazy<MainViewModel> mainViewModel, Lazy<StartViewModel> startViewModel) { // Upgrade the settings from a previous version when the new version starts the first time. if (Settings.Default.IsUpgradeNeeded) { Settings.Default.Upgrade(); Settings.Default.IsUpgradeNeeded = false; } // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy. InitializeCultures(); presentationService.InitializeCultures(); this.environmentService = environmentService; this.fileController = fileController.Value; this.richTextDocumentController = richTextDocumentController.Value; this.printController = printController.Value; this.shellViewModel = shellViewModel.Value; this.mainViewModel = mainViewModel.Value; this.startViewModel = startViewModel.Value; shellService.ShellView = this.shellViewModel.View; this.shellViewModel.Closing += ShellViewModelClosing; this.exitCommand = new DelegateCommand(Close); }
protected void ShutdownPrintController() { printController.Shutdown(); printController = null; }
internal PrintController InitializePrintController() { printController = container.GetExportedValue<PrintController>(); printController.Initialize(); return printController; }