Example #1
0
        public CoreApp(IChapterHeading chapterHeading, IVerseView verseView, ISimpleStorage simpleStorage,
                       IHistoryControls historyControls, int initialJump)
        {
            _chapterHeading  = chapterHeading;
            _verseView       = verseView;
            _historyControls = historyControls;

            // Load history.
            _history = new History(simpleStorage);

            // Keep track of changes to the verse view.
            verseView.OnScroll     += UpdateCurrentLocation;
            verseView.OnSwipeLeft  += MoveNextChapter;
            verseView.OnSwipeRight += MovePreviousChapter;

            // Wire up history to the history controls.
            historyControls.BackClick    += MoveBack;
            historyControls.ForwardClick += MoveForward;
            _history.CanMoveChanged      += EnableDisableHistoryButtons;

            // If the app has to jump to a verse, then insert it into the history.
            if (initialJump != Bible.InvalidAbsoluteVerseNumber)
            {
                _history.AddJump(_history.CurrentAbsoluteVerseNumber, initialJump);
            }

            // Pick up where we left off.
            verseView.Jump(Location.Create(_history.CurrentAbsoluteVerseNumber));

            EnableDisableHistoryButtons();
        }
Example #2
0
 private void MoveForward()
 {
     _verseView.Jump(Location.Create(_history.MoveForward(_verseView.CurrentAbsoluteVerseNumber)));
 }