Пример #1
0
        public WindowViewModel(PositionData positionData, BiblewordPositionData biblewordPositionData)
        {
            var fadeInWriter = new FadeInWriter(positionData, biblewordPositionData);

            HistoryViewModel = new HistoryViewModel(fadeInWriter);

            _log.Info("Load Data");
            _gbData = new HymnalInputViewModel(HymnalJsonReader.LoadHymnalData($"{Directory.GetCurrentDirectory()}/DataSource/GB_Data.json"), "Gesangbuch", fadeInWriter, HistoryViewModel);
            _cbData = new HymnalInputViewModel(HymnalJsonReader.LoadHymnalData($"{Directory.GetCurrentDirectory()}/DataSource/CB_Data.json"), "Chorbuch", fadeInWriter, HistoryViewModel);

            HymnalInputVisible   = true;
            BibleInputVisible    = false;
            CustomInputVisible   = false;
            MinistryInputVisible = false;

            _log.Info("Load Ministry");
            MinistryViewModel   = new MinistryViewModel(fadeInWriter, HistoryViewModel);
            CustomizedViewModel = new CustomizedInsertViewModel(fadeInWriter, HistoryViewModel);

            _log.Info("Load PreviewMode");
            PreviewViewModel = new PreviewViewModel(fadeInWriter.CurrentFade);

            ConfigViewModel.OnLoadMinistries       += UpdateMinistries;
            ConfigViewModel.OnResetMinistries      += ResetMinistries;
            ConfigViewModel.OnUpdateFullscreenMode += UpdateFullscreenMode;
            ConfigViewModel.OnUpdatePreview        += UpdatePreviewMode;
            ConfigViewModel.OnSaveMinistries       += SaveMinistries;
            fadeInWriter.OnInsertUpdate            += UpdatePreview;

            CurrentHymnalViewModel = _gbData;

            _previewWindow = new PreviewWindowController(PreviewViewModel);

            _log.Info("ReadBible");
            BibleViewModel = new BibleViewModel(BibleJsonReader.LoadBibleData($"{Directory.GetCurrentDirectory()}/DataSource/Bible_Data.json"), fadeInWriter, HistoryViewModel);
            //BibleViewModel.OpenBibleBrowser += OnOpenBibleBrowser;

            _log.Info("Create Preview");
            SetPreview(Properties.Settings.Default.ShowPreviewPicture);

            if (Properties.Settings.Default.ShowInsertInFullscreen)
            {
                _previewWindow.Show();
            }
        }
Пример #2
0
 private void UpdatePreview(object sender, Bitmap e)
 {
     PreviewViewModel.SetPreview(e);
 }