Наследование: System.Waf.Applications.Controller
Пример #1
0
        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);
        }
Пример #2
0
        public ModuleController(IEnvironmentService environmentService, ISettingsService settingsService, IPresentationService presentationService,
                                ShellService shellService, Lazy <FileController> fileController, Lazy <RichTextDocumentController> richTextDocumentController,
                                Lazy <PrintController> printController, Lazy <ShellViewModel> shellViewModel, Lazy <MainViewModel> mainViewModel,
                                Lazy <StartViewModel> startViewModel)
        {
            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            settingsService.ErrorOccurred += (sender, e) => Log.Default.Error(e.Error, "Error in SettingsService");
            InitializeCultures(settingsService.Get <AppSettings>());
            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;
            exitCommand = new DelegateCommand(Close);
        }