Example #1
0
        /// <inheritdoc />
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync().ConfigureAwait(true);

            // Get review collection
            _reviewCollection = _spacedRepetition.GetReviewCollection(_database);

            // Wait for initialization

            if (!_reviewCollection.Initialized.IsCompleted && !_reviewCollection.Initialized.Wait(100))
            {
                _pleaseWaitService.Push(_languageService.GetString("SpacedRepetition_Review_Loading"));

                if (await _reviewCollection.Initialized.ConfigureAwait(true))
                {
                    DisplayCard();
                }

                _pleaseWaitService.Pop();
            }
            else if (_reviewCollection.Initialized.Result)
            {
                DisplayCard();
            }
        }
Example #2
0
        private async Task <bool> OnContentChangeAsync()
        {
            MessageResult messageResult =
                await
                _messageService.ShowAsync(
                    _languageService.GetString(
                        "SpacedRepetition_Review_NavigateAwayPrompt"), string.Empty,
                    MessageButton.YesNoCancel, MessageImage.Question)
                .ConfigureAwait(true);

            // Cancel review
            if (messageResult == MessageResult.No)
            {
                _reviewCollection = null;
            }

            return(messageResult != MessageResult.Cancel);
        }
Example #3
0
 public ReviewManager(IReviewCollection collection, IBeerCollection beerCollection)
 {
     Collection     = collection;
     BeerCollection = beerCollection;
 }
Example #4
0
 public BeerManager(IBeerCollection collection, IReviewCollection reviewCollection)
 {
     Collection       = collection;
     ReviewCollection = reviewCollection;
 }