public SettingsControlViewModel(IMessageBox messageBox,
                                        IConfigurationService <Configuration> configService,
                                        Configuration config,
                                        SettingsView generalSettings,
                                        SettingsView todoSettings,
                                        SettingsView inspectionSettings,
                                        SettingsView unitTestSettings,
                                        SettingsView indenterSettings,
                                        SettingsView autoCompleteSettings,
                                        SettingsView windowSettings,
                                        SettingsView referenceSettings,
                                        SettingsViews activeView = UI.Settings.SettingsViews.GeneralSettings)
        {
            _messageBox    = messageBox;
            _configService = configService;
            _config        = config;

            SettingsViews = new ObservableCollection <SettingsView>
            {
                generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings, autoCompleteSettings, windowSettings, referenceSettings
            };

            SelectedSettingsView = SettingsViews.First(v => v.View == activeView);

            OKButtonCommand     = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => SaveAndCloseWindow());
            CancelButtonCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => CloseWindow());
            ResetButtonCommand  = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => ResetSettings());
        }
Exemplo n.º 2
0
        public SettingsControlViewModel(IGeneralConfigService configService,
                                        Configuration config,
                                        SettingsView generalSettings,
                                        SettingsView todoSettings,
                                        SettingsView inspectionSettings,
                                        SettingsView unitTestSettings,
                                        SettingsView indenterSettings,
                                        SettingsViews activeView = UI.Settings.SettingsViews.GeneralSettings)
        {
            _configService = configService;
            _config        = config;

            SettingsViews = new ObservableCollection <SettingsView>
            {
                generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings
            };

            SelectedSettingsView = SettingsViews.First(v => v.View == activeView);

            _okButtonCommand     = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => SaveAndCloseWindow());
            _cancelButtonCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => CloseWindow());
            _resetButtonCommand  = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => ResetSettings());
        }