void OnPrevious()
        {
            App.ButtonPlayer?.Play();

            if (game.PreviousQuestion())
            {
                NextSelected.ChangeCanExecute();
                BackSelected.ChangeCanExecute();
                RaiseAllPropertiesChanged();
            }
        }
示例#2
0
 private void SelectAnim_Completed(object sender, EventArgs e)
 {
     if (((SolidColorBrush)backBtn.Background).Color != IDLE_COLOR)
     {
         BackSelected?.Invoke();
         Button_MouseUp(backBtn, null);
     }
     else if (((SolidColorBrush)nextBtn.Background).Color != IDLE_COLOR)
     {
         NextSelected?.Invoke();
         Button_MouseUp(nextBtn, null);
     }
 }
        private void CheckTextBox()
        {
            string[]   texts         = moneyText.Text.Replace(" ", "").Split(',');
            List <int> moneySelected = new List <int>();

            for (int i = 0; i < texts.Length; i++)
            {
                if (texts[i].Contains("-"))
                {
                    string[] splittedString = texts[i].Split('-');
                    int      firstNumber, secondNumber = 0;
                    if (splittedString.Length == 2 && int.TryParse(splittedString[0], out firstNumber) &&
                        int.TryParse(splittedString[1], out secondNumber) && firstNumber <= secondNumber)
                    {
                        for (int j = firstNumber; j <= secondNumber; j++)
                        {
                            if (!moneySelected.Contains(j))
                            {
                                moneySelected.Add(j);
                            }
                        }
                    }
                    else
                    {
                        ErrorHandling();
                        return;
                    }
                }
                else
                {
                    int number = 0;
                    if (int.TryParse(texts[i], out number))
                    {
                        if (!moneySelected.Contains(number))
                        {
                            moneySelected.Add(number);
                        }
                    }
                    else
                    {
                        ErrorHandling();
                        return;
                    }
                }
            }
            moneyText.BorderBrush = Brushes.Black;
            BackSelected?.Invoke(this, new ListEventArgs <int>()
            {
                list = moneySelected
            });
        }
        async void OnNext()
        {
            App.ButtonPlayer?.Play();

            if (game.NextQuestion() == true)
            {
                NextSelected.ChangeCanExecute();
                BackSelected.ChangeCanExecute();
                RaiseAllPropertiesChanged();
            }
            else
            {
                isTimerRunning = false;
                var nav = DependencyService.Get <NavigationService>();
                if (nav != null)
                {
                    await nav.GotoPageAsync(AppPage.ReviewPage);
                }
            }
        }