private async Task InitializeSetPage(CardSetModel cardSetModel)
      {
          if (cardSetModel != null && cardSetModel.FlashcardCollection.Count > 0)
          {
              FlashCardSet              = cardSetModel;
              CurrentFlashcardIndex     = 0;
              IndexOfFirstUnstarredCard = cardSetModel.FlashcardCollection.Count;
              for (int i = 0; i < cardSetModel.FlashcardCollection.Count; i++)
              {
                  if (!cardSetModel.FlashcardCollection[i].IsStarred)
                  {
                      IndexOfFirstUnstarredCard = i;
                      break;
                  }
              }

              PopulateQuizOptions();
          }
          else
          {
              throw new ArgumentNullException("Can't send null set to study page");
          }
          OnPropertyChanged("FlashCardSet");
          OnPropertyChanged("CurrentFlashcardIndex");
          OnPropertyChanged("CurrentFlashcard");

          lock (myLocker) {
              prCanUseKeyDown = false;
          }
          await InstructionsDialogService.ShowAsync(InstructionDialogType.MultipleChoiceStudyInstructions);

          lock (myLocker) {
              prCanUseKeyDown = true;
          }
      }
 public MainMenuViewModel(INavigationService navigationService) : base(navigationService)
 {
     Messenger.Default.Register <CardSetModel>(this, "AddSet", async addedCardSet => await ReceiveEditSetMessage(addedCardSet));
     Messenger.Default.Register <CardSetModel>(this, "EditSet", async editedCardSet => await ReceiveEditSetMessage(editedCardSet));
     AddEmptySetCommand       = new RelayCommand(AddEmptySetAction, CanExecuteFunctions);
     ImportSetFromFileCommand = new RelayCommand(ImportSetFromFileAction, CanExecuteFunctions);
     EditSetCommand           = new RelayCommand <CardSetModel>(EditSetAction, CanExecuteFunctions);
     ArchiveSetCommand        = new RelayCommand <CardSetModel>(ArchiveSetFunction, CanExecuteFunctions);
     DeleteSetCommand         = new RelayCommand <CardSetModel>(DeleteSetAction, CanExecuteFunctions);
     GoToSetCommand           = new RelayCommand <ItemClickEventArgs>(GoToSetAction, CanExecuteFunctions);
     NumSetsLoaded            = new NotifyTaskCompletion <string>(this.LoadStartingData());
     GoToSettingsCommand      = new RelayCommand(GoToSettingsAction);
     ResizeColumnWidthCommand = new RelayCommand <SizeChangedEventArgs>(ResizeColumnWidthFunction);
     InstructionsDialogService.ShowAsync(InstructionDialogType.MainInstructions).FireAndForgetSafeAsync(this);
 }
 private async void ShowInstructionsAction()
 {
     await InstructionsDialogService.ShowAsync(InstructionDialogType.BasicStudyInstructions, true);
 }
 private async void ShowValidFileFormatsAction()
 {
     await InstructionsDialogService.ShowAsync(InstructionDialogType.ValidFileFormats);
 }
        private async void ShowMainInstructionsAction()
        {
            await InstructionsDialogService.ShowAsync(InstructionDialogType.MainInstructions, true);

            UpdateSettings();
        }
 private async void ShowMultipleChoiceInstructionsAction()
 {
     await InstructionsDialogService.ShowAsync(InstructionDialogType.MultipleChoiceStudyInstructions, true);
 }
Ejemplo n.º 7
0
 private async void ShowFillBlankInstructionsAction()
 {
     await InstructionsDialogService.ShowAsync(InstructionDialogType.FillBlankStudyInstructions, true);
 }