public FileController(IMessageService messageService, ISystemService systemService, IFileDialogService fileDialogService, ISettingsService settingsService, IShellService shellService, FileService fileService, ExportFactory<SaveChangesViewModel> saveChangesViewModelFactory, IRichTextDocumentType richTextDocumentType, IXpsExportDocumentType xpsExportDocumentType) { this.messageService = messageService; this.systemService = systemService; this.fileDialogService = fileDialogService; this.shellService = shellService; this.fileService = fileService; this.saveChangesViewModelFactory = saveChangesViewModelFactory; documentTypes = new() { richTextDocumentType, xpsExportDocumentType }; newCommand = new DelegateCommand(NewCommand); openCommand = new DelegateCommand(OpenCommand); closeCommand = new DelegateCommand(CloseCommand, CanCloseCommand); saveCommand = new DelegateCommand(SaveCommand, CanSaveCommand); saveAsCommand = new DelegateCommand(SaveAsCommand, CanSaveAsCommand); settings = settingsService.Get<AppSettings>(); this.fileService.NewCommand = newCommand; this.fileService.OpenCommand = openCommand; this.fileService.CloseCommand = closeCommand; this.fileService.SaveCommand = saveCommand; this.fileService.SaveAsCommand = saveAsCommand; recentFileList = settings.RecentFileList ?? new RecentFileList(); this.fileService.RecentFileList = recentFileList; fileService.PropertyChanged += FileServicePropertyChanged; }
public RichTextDocument(IRichTextDocumentType documentType, FlowDocument?content = null) : base(documentType) { Content = content ?? new FlowDocument(); }