Esempio n. 1
0
        private void SetPreview(bool state)
        {
            _gbData.UpdateButtons(state);
            _cbData.UpdateButtons(state);
            BibleViewModel.UpdateButtons(state);
            CustomizedViewModel.UpdateButtons(state);
            MinistryViewModel.UpdateButtons(state);

            if (state)
            {
                InsertWith        = "535";
                With              = "1200";
                Hight             = "790";
                PrviewVisibleFlag = true;
                OnPropertyChanged(nameof(InsertWith));
                OnPropertyChanged(nameof(With));
                OnPropertyChanged(nameof(Hight));
                OnPropertyChanged(nameof(PrviewVisibleFlag));
                return;
            }
            PrviewVisibleFlag = false;
            InsertWith        = "583";
            With  = "600";
            Hight = "550";
            OnPropertyChanged(nameof(InsertWith));
            OnPropertyChanged(nameof(With));
            OnPropertyChanged(nameof(Hight));
            OnPropertyChanged(nameof(PrviewVisibleFlag));
        }
Esempio n. 2
0
 private void OnCloseWindow(object obj)
 {
     CustomizedViewModel.SaveInserts();
     MinistryViewModel.SaveMinistries();
     Properties.Settings.Default.Save();
     _previewWindow.Close();
 }
Esempio n. 3
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();
            }
        }
Esempio n. 4
0
 private void SaveMinistries(object sender, EventArgs e)
 {
     MinistryViewModel.SaveMinistries();
 }
Esempio n. 5
0
 private void UpdateMinistries(object sender, ObservableCollection <MinistryGridViewModel> e)
 {
     MinistryViewModel.UpdateMinistries(e);
 }
Esempio n. 6
0
 private void ResetMinistries(object sender, EventArgs e)
 {
     MinistryViewModel.Reset();
 }