Beispiel #1
0
        public ShellViewModel(IPresentationService presentationService,
                              IShellSettingsService shellSettingsService,
                              IEventAggregator eventAggregator,
                              IMenuViewModel menu,
                              ISettingsViewModel settings,
                              ICodeGenSettingsService codeGenSettingsService,
                              ICodeGenSettings codeGenSettings,
                              IMessageService messageService,
                              IMappingViewModel mapping,
                              ISchemaService schemaService,
                              ICustomSchemaSqlViewModel customSchemaSqlViewModel,
                              ITemplateWriterService templateWriterService)
        {
            this._shellSettingsService   = shellSettingsService;
            this._codeGenSettingsService = codeGenSettingsService;
            this._codeGenSettings        = codeGenSettings;
            this._messageService         = messageService;
            this._templateWriterService  = templateWriterService;
            this.Menu                     = menu;
            this.Settings                 = settings;
            this.Mapping                  = mapping;
            this._schemaService           = schemaService;
            this.CustomSchemaSqlViewModel = customSchemaSqlViewModel;
            this.WindowClosing            = new Command <CancelEventArgs>(OnWindowClosing);
            this.WindowDrop               = new Command <DragEventArgs>(OnWindowDrop);

            this.DisplayText = "IQToolkit CodeGen";
            this.SetWindowPosition(presentationService);

            eventAggregator.GetEvent <LoadSchemaEvent>().Subscribe(this.LoadSchemaEventHandler);
            eventAggregator.GetEvent <GenerateFilesEvent>().Subscribe(_ => this.GenerateFilesEventHandler());
            eventAggregator.GetEvent <CustomSchemaSqlViewVisibilityChangedEvent>().Subscribe(this.CustomSchemaSqlViewVisibilityChangedEvent);
        }
        /// <summary>
        /// Initializes a new <see cref="MainWindowViewModel"/>
        /// </summary>
        /// <param name="hubHubDataSourceViewModelViewModel">A <see cref="IHubDataSourceViewModel"/></param>
        /// <param name="dstSourceViewModelViewModel">A <see cref="IHubDataSourceViewModel"/></param>
        /// <param name="dstController">The <see cref="IDstController"/></param>
        /// <param name="hubNetChangePreviewViewModel">The <see cref="IHubNetChangePreviewViewModel"/></param>
        /// <param name="mappingViewModel">The <see cref="IMappingViewModel"/></param>
        /// <param name="transferControlViewModel">The <see cref="ITransferControlViewModel"/></param>
        /// <param name="statusBarControlViewModel">The <see cref="IStatusBarControlViewModel"/></param>
        /// <param name="navigationService">The <see cref="INavigationService"/></param>
        public MainWindowViewModel(IHubDataSourceViewModel hubHubDataSourceViewModelViewModel,
                                   IDstDataSourceViewModel dstSourceViewModelViewModel,
                                   IDstController dstController,
                                   IHubNetChangePreviewViewModel hubNetChangePreviewViewModel,
                                   ITransferControlViewModel transferControlViewModel,
                                   IMappingViewModel mappingViewModel,
                                   IStatusBarControlViewModel statusBarControlViewModel,
                                   INavigationService navigationService
                                   )
        {
            this.dstController                = dstController;
            this.HubDataSourceViewModel       = hubHubDataSourceViewModelViewModel;
            this.DstSourceViewModel           = dstSourceViewModelViewModel;
            this.HubNetChangePreviewViewModel = hubNetChangePreviewViewModel;
            this.MappingViewModel             = mappingViewModel;
            this.TransferControlViewModel     = transferControlViewModel;
            this.StatusBarControlViewModel    = statusBarControlViewModel;
            this.navigationService            = navigationService;

            this.InitializeCommands();
        }