Esempio n. 1
0
        public EditTextViewModel(IOptionsService optionsService, IVerseEditorService verseEditorService)
        {
            _optionsService     = optionsService;
            _verseEditorService = verseEditorService;

            AddDesignTimeItems();
        }
Esempio n. 2
0
 public ImagesService(
     IOptionsService optionsService,
     IUserInterfaceService userInterfaceService,
     IVerseEditorService verseEditorService)
 {
     _optionsService       = optionsService;
     _userInterfaceService = userInterfaceService;
     _verseEditorService   = verseEditorService;
 }
Esempio n. 3
0
        public MainViewModel(
            ScripturesViewModel scripturesViewModel,
            PreviewViewModel previewViewModel,
            SettingsViewModel settingsViewModel,
            EditTextViewModel editVerseTextViewModel,
            StartupViewModel startupViewModel,
            IImagesService imagesService,
            IOptionsService optionsService,
            ISnackbarService snackbarService,
            IUserInterfaceService userInterfaceService,
            ICommandLineService commandLineService,
            IVerseEditorService verseEditorService)
        {
            _scripturesViewModel    = scripturesViewModel;
            _previewViewModel       = previewViewModel;
            _settingsViewModel      = settingsViewModel;
            _editVerseTextViewModel = editVerseTextViewModel;
            _startupViewModel       = startupViewModel;
            _commandLineService     = commandLineService;
            _verseEditorService     = verseEditorService;

            if (commandLineService.NoGpu || ForceSoftwareRendering())
            {
                // disable hardware (GPU) rendering so that it's all done by the CPU...
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
            }

            _settingsViewModel.EpubChangedEvent += HandleEpubChangedEvent;

            _previewViewModel.EditTextCommandEvent += HandleEditTextCommandEvent;

            _imagesService        = imagesService;
            _optionsService       = optionsService;
            _snackbarService      = snackbarService;
            _userInterfaceService = userInterfaceService;

            _optionsService.AlwaysOnTopChangedEvent += HandleAlwaysOnTopChangedEvent;
            _optionsService.EpubPathChangedEvent    += HandleEpubPathChangedEvent;

            InitCommands();

            _currentPage     = scripturesViewModel;
            _preSettingsPage = scripturesViewModel;

            if (IsNewInstallation())
            {
                _currentPage = startupViewModel;
            }
            else if (IsBadEpubPath())
            {
                _currentPage = settingsViewModel;
            }

            _nextPageTooltip = Properties.Resources.NEXT_PAGE_PREVIEW;

            GetVersionData();
        }
Esempio n. 4
0
        public PreviewViewModel(
            IImagesService imagesService,
            IDisplayWindowService displayWindowService,
            IOptionsService optionsService,
            ISnackbarService snackbarService,
            IVerseEditorService verseEditorService)
        {
            _imagesService        = imagesService;
            _displayWindowService = displayWindowService;
            _optionsService       = optionsService;
            _snackbarService      = snackbarService;
            _verseEditorService   = verseEditorService;

            _optionsService.MediaMonitorChangedEvent += HandleMediaMonitorChangedEvent;
            _optionsService.StyleChangedEvent        += HandleStyleChangedEvent;
            _optionsService.ThemePathChangedEvent    += HandleThemePathChangedEvent;

            InitCommands();
        }