示例#1
0
 public PlayViewModel(int DeckID)
 {
     DeckDatabase = new DeckDB();
     Deck         = DeckDatabase.GetDeck(DeckID);
     CardDatabase = new CardDB(Deck);
     GetHand();
     this.navigation = navigation;
     RightAnswer     = new Command(Right);
     WrongAnswer     = new Command(Wrong);
     Flip            = new Command(FlipIt);
 }
示例#2
0
 public ByScoreViewModel(int DeckID)
 {
     DeckDatabase = new DeckDB();
     this.Deck    = DeckDatabase.GetDeck(DeckID);
     CardDatabase = new CardDB(Deck);
     HandSize     = Settings.HandSize;
     RightAnswer  = new Command(Right);
     WrongAnswer  = new Command(Wrong);
     Flip         = new Command(FlipIt);
     Random       = new Random();
     GetCards();
 }
示例#3
0
 public MultiChoiceViewModel(int DeckID)
 {
     DeckDatabase = new DeckDB();
     this.Deck    = DeckDatabase.GetDeck(DeckID);
     CardDatabase = new CardDB(Deck);
     Cards        = CardDatabase.GetCards();
     GetHand();
     Answers  = new ObservableCollection <AnswerCard>();
     Pick     = new Command(Picked);
     Position = 0;
     index    = 0;
     Setup();
 }
示例#4
0
        void NavToPlayPage(object s)
        {
            var deckLabel = s as DeckLabel;
            var deck      = DeckDatabase.GetDeck(deckLabel.ID);

            if (Type == 1)
            {
                Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new PlayPage(deck));
            }
            else if (Type == 2)
            {
                Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new MultiChoicePage(deck));
            }
            else if (Type == 3)
            {
                Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new ByScorePage(deck));
            }
            else if (Type == 4)
            {
                Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new NotificationSettingsPage(deck));
            }
        }