Esempio n. 1
0
 public CodeGenSettingsService(ICodeGenSettings settings, IFileDialogService fileDialogService, IMostRecentlyUsedFileService mostRecentlyUsedFileService, IXmlSerializerService xmlSerializerService)
 {
     this._settings                    = settings;
     this._fileDialogService           = fileDialogService;
     this._mostRecentlyUsedFileService = mostRecentlyUsedFileService;
     this._xmlSerializerService        = xmlSerializerService;
 }
Esempio n. 2
0
        public MenuViewModel(ICodeGenSettingsService codeGenSettingsService,
                             IMostRecentlyUsedFileService mostRecentlyUsedFileService,
                             IEventAggregator eventAggregator,
                             IApplicationService applicationService)
        {
            this._codeGenSettingsService = codeGenSettingsService;

            this.NewCommand            = new Command(this.ExecuteNewCommand);
            this.OpenCommand           = new Command(this.ExecuteOpenCommand);
            this.SaveCommand           = new Command(this.ExecuteSaveCommand, this.CanExecuteSaveCommand);
            this.SaveAsCommand         = new Command(this.ExecuteSaveAsCommand);
            this.OpenRecentFileCommand = new Command <RoutedEventArgs>(this.ExecuteOpenRecentFileCommand);
            this.ExitCommand           = new Command(x => applicationService.Shutdown());
            this.RecentFiles           = new ObservableCollection <string>();
            this.UpdateRecentFiles(mostRecentlyUsedFileService.GetList());
            this._eventAggregator = eventAggregator;
            this._eventAggregator.GetEvent <MostRecentlyUsedFileChangedEvent>().Subscribe(this.UpdateRecentFiles);
        }