Ejemplo n.º 1
0
        /// <inheritdoc />
        public SettingsService(
            IDbContextFactory dbContextFactory,
            ISettingHandlerFactory settingHandlerFactory,
            ISettingsRegistry registry,
            SettingsApiClient apiClient,
            ILogger logger)
        {
            _settings      = new ConcurrentDictionary <string, object>();
            _loadSemaphore = new SemaphoreSlim(1, 1);

            _dbContextFactory      = dbContextFactory;
            _settingHandlerFactory = settingHandlerFactory;
            _registry  = registry;
            _apiClient = apiClient;
            _logger    = logger;
        }
Ejemplo n.º 2
0
        public SettingsViewModel(
            ISettingsRegistry settingsRegistry,
            ISettingsService settingsService,
            IDialogService dialogService,
            SettingsSerializer settingsSerializer)
        {
            _settingsRegistry   = settingsRegistry;
            _settingsService    = settingsService;
            _dialogService      = dialogService;
            _settingsSerializer = settingsSerializer;

            RefreshCommand = new DelegateCommand(async() => await LoadAsync(), () => !IsBusy);
            ImportCommand  = new DelegateCommand(async() => await ImportAsync(), () => !IsBusy);
            ExportCommand  = new DelegateCommand(async() => await ExportAsync(), () => !IsBusy);

            AddCommandBinding(CustomApplicationCommands.Refresh, RefreshCommand);
            AddCommandBinding(CustomApplicationCommands.Import, ImportCommand);
            AddCommandBinding(CustomApplicationCommands.Export, ExportCommand);
        }