Exemplo n.º 1
0
        public ShellViewModel(
            IDialogService dialogService,
            IEventAggregator eventAggregator,
            MdiViewModel mdi,
            SettingsViewModel settingsViewModel,
            UpdaterViewModel updaterViewModel,
            Func <DocumentViewModel> documentViewModelFactory,
            IDocumentFactory documentFactory,
            IFileSystem fileSystem,
            SearchSettings searchSettings, IOpenDocumentFromWeb openDocumentFromWeb)
        {
            this.eventAggregator = eventAggregator;
            this.dialogService   = dialogService;
            MDI     = mdi;
            Updater = updaterViewModel;
            this.documentViewModelFactory = documentViewModelFactory;
            this.documentFactory          = documentFactory;
            this.fileSystem          = fileSystem;
            SearchSettings           = searchSettings;
            this.openDocumentFromWeb = openDocumentFromWeb;

            Settings = settingsViewModel;
            Settings.Initialize();
            NewDocumentCommand       = new DelegateCommand(() => NewDocument());
            NewJekyllDocumentCommand = new DelegateCommand(() => NewDocument(CreateJekyllHeader()));
            SaveDocumentCommand      = new AwaitableDelegateCommand(SaveDocument, () => !IsWorking);
            SaveDocumentAsCommand    = new AwaitableDelegateCommand(SaveDocumentAs, () => !IsWorking);
            SaveAllDocumentsCommand  = new AwaitableDelegateCommand(SaveAllDocuments, () => !IsWorking);
            PublishDocumentCommand   = new AwaitableDelegateCommand(PublishDocument, () => !IsWorking);
            OpenDocumentCommand      = new DelegateCommand(OpenDocument, () => !IsWorking);
            OpenFromWebCommand       = new AwaitableDelegateCommand(OpenFromWeb, () => !IsWorking);
            CloseDocumentCommand     = new DelegateCommand(CloseDocument, () => ActiveDocumentViewModel != null);

            ActivateItem(mdi);
        }
Exemplo n.º 2
0
        public ShellViewModel(
            IDialogService dialogService,
            IEventAggregator eventAggregator,
            MdiViewModel mdi,
            SettingsViewModel settingsViewModel,
            UpdaterViewModel updaterViewModel,
            Func <DocumentViewModel> documentViewModelFactory,
            IDocumentFactory documentFactory,
            IFileSystem fileSystem,
            SearchSettings searchSettings)
        {
            this.eventAggregator = eventAggregator;
            this.dialogService   = dialogService;
            MDI     = mdi;
            Updater = updaterViewModel;
            this.documentViewModelFactory = documentViewModelFactory;
            this.documentFactory          = documentFactory;
            this.fileSystem = fileSystem;
            SearchSettings  = searchSettings;

            Settings = settingsViewModel;
            Settings.Initialize();

            ActivateItem(mdi);
        }