public MinistryViewModel(FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
        {
            _historyViewModel = historyViewModel;
            _fadeInWriter     = fadeInWriter;
            Ministries        = new ObservableCollection <MinistryGridViewModel>();

            if (_readerWriter.LoadMinistryData() != null)
            {
                Ministries = _readerWriter.LoadMinistryData();
            }

            UpdateFunctionList();

            MinistryViewSource.Source     = Ministries;
            Ministries.CollectionChanged += CollectionChanged;
            MinistryViewSource.Filter    += MinistryViewSource_Filter;
        }
        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();
            }
        }
Exemple #3
0
 public HymnalInputViewModel(List <Song> hymnalList, string bookname, FadeInWriter fadeInWriter, HistoryViewModel historyViewModel)
 {
     VerseList         = new ObservableCollection <SelectedVerse>();
     _historyViewModel = historyViewModel;
     _fadeInWriter     = fadeInWriter;
     _currentHymnal    = hymnalList;
     _bookname         = bookname;
 }