public FileController(IMessageService messageService, IFileDialogService fileDialogService, IShellService shellService, FileService fileService, ExportFactory<SaveChangesViewModel> saveChangesViewModelFactory) { this.messageService = messageService; this.fileDialogService = fileDialogService; this.shellService = shellService; this.fileService = fileService; this.saveChangesViewModelFactory = saveChangesViewModelFactory; this.documentTypes = new List<IDocumentType>(); this.newCommand = new DelegateCommand(NewCommand); this.openCommand = new DelegateCommand(OpenCommand); this.closeCommand = new DelegateCommand(CloseCommand, CanCloseCommand); this.saveCommand = new DelegateCommand(SaveCommand, CanSaveCommand); this.saveAsCommand = new DelegateCommand(SaveAsCommand, CanSaveAsCommand); this.fileService.NewCommand = newCommand; this.fileService.OpenCommand = openCommand; this.fileService.CloseCommand = closeCommand; this.fileService.SaveCommand = saveCommand; this.fileService.SaveAsCommand = saveAsCommand; this.recentFileList = Settings.Default.RecentFileList ?? new RecentFileList(); this.fileService.RecentFileList = recentFileList; PropertyChangedEventManager.AddHandler(fileService, FileServicePropertyChanged, ""); }
public FileController(CompositionContainer container, IMessageService messageService, IFileDialogService fileDialogService, IShellService shellService, FileService fileService) { this.container = container; this.messageService = messageService; this.fileDialogService = fileDialogService; this.shellService = shellService; this.fileService = fileService; this.documentTypes = new List<IDocumentType>(); this.newCommand = new DelegateCommand(NewCommand); this.openCommand = new DelegateCommand(OpenCommand); this.closeCommand = new DelegateCommand(CloseCommand, CanCloseCommand); this.saveCommand = new DelegateCommand(SaveCommand, CanSaveCommand); this.saveAsCommand = new DelegateCommand(SaveAsCommand, CanSaveAsCommand); this.fileService.NewCommand = newCommand; this.fileService.OpenCommand = openCommand; this.fileService.CloseCommand = closeCommand; this.fileService.SaveCommand = saveCommand; this.fileService.SaveAsCommand = saveAsCommand; this.recentFileList = Settings.Default.RecentFileList; if (this.recentFileList == null) { this.recentFileList = new RecentFileList(); } this.fileService.RecentFileList = recentFileList; AddWeakEventListener(fileService, FileServicePropertyChanged); }