コード例 #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            _iocContainer
            .RegisterType <IViewServiceProvider, ViewServiceProvider>(Lifetime.Singleton)
            .RegisterType <IEventAggregator, EventAggregator>(Lifetime.Singleton)

            .RegisterType <IMainViewModel, MainWindowViewModel>(Lifetime.Singleton)
            .RegisterType <IMainWindow, MainWindow>()

            .RegisterType <ICommand, ReadCsvCommand>(ReadCsvCommand.CommandName)
            .RegisterType <ICommand, WriteCsvCommand>(WriteCsvCommand.CommandName)
            .RegisterType <ICommand, RunConfigCommand>(RunConfigCommand.CommandName)
            .RegisterType <ICommand, SaveConfigCommand>(SaveConfigCommand.CommandName)
            .RegisterType <ICommand, SaveConfigAsCommand>(SaveConfigAsCommand.CommandName)
            .RegisterType <ICommand, ConfigSettingsCommand>(ConfigSettingsCommand.CommandName)

            .RegisterType <ICommand, QueryCommand>(QueryCommand.CommandName, Lifetime.Singleton)              // F5
            .RegisterType <ICommand, ResetQueryCommand>(ResetQueryCommand.CommandName, Lifetime.Singleton)    // F6

            .RegisterInstance <StartupEventArgs>(e);

            var viewService = _iocContainer.Resolve <IViewServiceProvider>();

            CsvConfigFileManager.InitializeDefault(viewService.GenerateConfigDialogService);

            _presenter = _iocContainer.Resolve <MainWindowPresenter>();
            MainWindow = (Window)_presenter.Initialize();
            MainWindow.Show();
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: pierre3/CsvEditSharp
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var viewService = new ViewServiceProvider();

            CsvConfigFileManager.InitializeDefault(viewService.GenerateConfigDialogService);
            var vm = new MainWindowViewModel(viewService, e.Args.FirstOrDefault());

            MainWindow = new MainWindow(vm);
            MainWindow.Show();
        }
コード例 #3
0
 public SelectConfigurationDialogViewModel(string currentFilePath)
 {
     OkCommand      = new DelegateCommand(_ => SelectConfiguration(currentFilePath), _ => SelectedItem != null);
     _configManager = CsvConfigFileManager.Default;
     SelectedItem   = Items.FirstOrDefault();
 }
コード例 #4
0
 public ConfigSettingsDialogViewModel()
 {
     _configManager = CsvConfigFileManager.Default;
 }