Пример #1
0
#pragma warning disable 4014
        public SettingsRepository(IStorageService storageService, ISqliteService sqliteService, IPlatformCodeService platformCodeService)
        {
            _storageService = storageService;
            _sqliteService = sqliteService;
            _platformCodeService = platformCodeService;
            Initialize();
        }
Пример #2
0
#pragma warning disable 4014
        public SettingsRepository(IStorageService storageService, ISqliteService sqliteService, IPlatformCodeService platformCodeService)
        {
            _storageService      = storageService;
            _sqliteService       = sqliteService;
            _platformCodeService = platformCodeService;
            Initialize();
        }
Пример #3
0
        public SettingsPageViewModel(ISettingsRepository settingsRepository, IArticleRepository articleRepository, IPlatformCodeService platformCodeService, IPermissionsService permissionsService)
        {
            _settingsRepository  = settingsRepository;
            _articleRepository   = articleRepository;
            _platformCodeService = platformCodeService;
            _permissionsService  = permissionsService;

            Sources  = _articleRepository.GetAllSources();
            Settings = _settingsRepository.GetEditSettings();
            foreach (var baseSettingModel in Settings)
            {
                baseSettingModel.PropertyChanged += BaseSettingModelOnPropertyChanged;
            }


            _saveCommand               = new LoadingRelayCommand(Save, () => _anythingChanged, true);
            _switchFeedStatusCommand   = new LoadingRelayCommand <FeedModel>(SwitchFeedStatus, f => true, true);
            _switchSourceStatusCommand = new LoadingRelayCommand <SourceModel>(SwitchSourceStatus, f => true, true);
            _resetApplicationCommand   = new LoadingRelayCommand(ResetApplication, () => true, true);

            if (!IsInDesignMode)
            {
                InitializeSettingsAsync();
            }
        }
Пример #4
0
        public ImageDownloadService(IPlatformCodeService platformCodeService, ISqliteService sqliteService, IPermissionsService permissionsService, IProgressService progressService)
        {
            _platformCodeService = platformCodeService;
            _permissionsService = permissionsService;
            _progressService = progressService;

            _maxHeight = _platformCodeService.DeviceHeight();
            _maxWidth = _platformCodeService.DeviceWidth();

            _genericRepository = new GenericRepository<ImageContentModel, ImageContentEntity>(sqliteService);
        }
Пример #5
0
        public ImageDownloadService(IPlatformCodeService platformCodeService, ISqliteService sqliteService, IPermissionsService permissionsService, IProgressService progressService)
        {
            _platformCodeService = platformCodeService;
            _permissionsService  = permissionsService;
            _progressService     = progressService;

            _maxHeight = _platformCodeService.DeviceHeight();
            _maxWidth  = _platformCodeService.DeviceWidth();

            _genericRepository = new GenericRepository <ImageContentModel, ImageContentEntity>(sqliteService);
        }
Пример #6
0
        public SettingsPageViewModel(ISettingsRepository settingsRepository, IArticleRepository articleRepository, IPlatformCodeService platformCodeService, IPermissionsService permissionsService)
        {
            _settingsRepository = settingsRepository;
            _articleRepository = articleRepository;
            _platformCodeService = platformCodeService;
            _permissionsService = permissionsService;

            Sources = _articleRepository.GetAllSources();
            Settings = _settingsRepository.GetEditSettings();
            foreach (var baseSettingModel in Settings)
                baseSettingModel.PropertyChanged += BaseSettingModelOnPropertyChanged;


            _saveCommand = new LoadingRelayCommand(Save, () => _anythingChanged, true);
            _switchFeedStatusCommand = new LoadingRelayCommand<FeedModel>(SwitchFeedStatus, f => true, true);
            _switchSourceStatusCommand = new LoadingRelayCommand<SourceModel>(SwitchSourceStatus, f => true, true);
            _resetApplicationCommand = new LoadingRelayCommand(ResetApplication, () => true, true);

            if (!IsInDesignMode)
                InitializeSettingsAsync();
        }
Пример #7
0
        public ArticlePageViewModel(ISettingsRepository settingsRepository, IArticleRepository articleRepository, IPlatformCodeService platformCodeService)
        {
            _settingsRepository  = settingsRepository;
            _articleRepository   = articleRepository;
            _platformCodeService = platformCodeService;

            _setDisplayState = new RelayCommand <DisplayState>(SetDisplayState);

            _makeFontBiggerCommand  = new RelayCommand(MakeFontBigger, () => CanMakeFontBigger);
            _makeFontSmallerCommand = new RelayCommand(MakeFontSmaller, () => CanMakeFontSmaller);
            _favoriteCommand        = new RelayCommand(Favorite);
            _openInBrowserCommand   = new RelayCommand(OpenInBrowser, () => CanOpenInBrowser);
            _shareCommand           = new RelayCommand(Share);
            _reloadArticleCommand   = new RelayCommand(ReloadArticle, () => CanReloadArticle);

            _goToStartCommand = new RelayCommand(GoToStart, () => CanGoToStart);
            _goLeftCommand    = new RelayCommand(GoLeft, () => CanGoLeft);
            _goRightCommand   = new RelayCommand(GoRight, () => CanGoRight);

            _startCommand = new RelayCommand(Start, () => CanStart);

            _increaseSpeedCommand = new RelayCommand(IncreaseSpeed, () => CanIncreaseSpeed);
            _decreaseSpeedCommand = new RelayCommand(DecreaseSpeed, () => CanDecreaseSpeed);

            _chooseFontCommand = new RelayCommand <string>(ChooseFont, CanChooseFont);

            if (IsInDesignMode)
            {
                FontSize     = 20;
                ReadingSpeed = 300;
                SelectArticle(_articleRepository.GetInfoArticle());
            }
            else
            {
                Initialize();
            }
        }
Пример #8
0
        public ArticlePageViewModel(ISettingsRepository settingsRepository, IArticleRepository articleRepository, IPlatformCodeService platformCodeService)
        {
            _settingsRepository = settingsRepository;
            _articleRepository = articleRepository;
            _platformCodeService = platformCodeService;

            _setDisplayState = new RelayCommand<DisplayState>(SetDisplayState);

            _makeFontBiggerCommand = new RelayCommand(MakeFontBigger, () => CanMakeFontBigger);
            _makeFontSmallerCommand = new RelayCommand(MakeFontSmaller, () => CanMakeFontSmaller);
            _favoriteCommand = new RelayCommand(Favorite);
            _openInBrowserCommand = new RelayCommand(OpenInBrowser, () => CanOpenInBrowser);
            _shareCommand = new RelayCommand(Share);
            _reloadArticleCommand = new RelayCommand(ReloadArticle, () => CanReloadArticle);

            _goToStartCommand = new RelayCommand(GoToStart, () => CanGoToStart);
            _goLeftCommand = new RelayCommand(GoLeft, () => CanGoLeft);
            _goRightCommand = new RelayCommand(GoRight, () => CanGoRight);

            _startCommand = new RelayCommand(Start, () => CanStart);

            _increaseSpeedCommand = new RelayCommand(IncreaseSpeed, () => CanIncreaseSpeed);
            _decreaseSpeedCommand = new RelayCommand(DecreaseSpeed, () => CanDecreaseSpeed);

            _chooseFontCommand = new RelayCommand<string>(ChooseFont, CanChooseFont);

            if (IsInDesignMode)
            {
                FontSize = 20;
                ReadingSpeed = 300;
                SelectArticle(_articleRepository.GetInfoArticle());
            }
            else
            {
                Initialize();
            }
        }
Пример #9
0
 public PermissionService(IPlatformCodeService platformCodeService, IDialogService dialogService)
 {
     _platformCodeService = platformCodeService;
     _dialogService       = dialogService;
 }
Пример #10
0
 public PermissionService(IPlatformCodeService platformCodeService, IDialogService dialogService)
 {
     _platformCodeService = platformCodeService;
     _dialogService = dialogService;
 }