AppStore.Templates.FlashCardPage.populateQuestion C# (CSharp) Method

populateQuestion() public method

It populates the flash card question of the index passed to the current view.
public populateQuestion ( int index ) : void
index int The index of flash card, which is to be populated in the view
return void
        public async void populateQuestion(int index)
        {
            if (index == 0) Previous.IsEnabled = false;
            else Previous.IsEnabled = true;
            int cardNum = index + 1;
            FlashNumber.Text = "Card #" + cardNum + " of " + flash.getCardList().Count;
            if (flash.getCardList().ElementAt(index).getImagePath() != null)
            {
                try
                {
                    FlashCard.Source = await base64image(flash.getCardList().ElementAt(index).getImagePath());
                }
                catch (Exception) { }
            }
            FlashText.Text = flash.getCardList().ElementAt(index).getAnswer();
            FlashHint.Text = flash.getCardList().ElementAt(index).getHint();
            if (flash.getCardList().ElementAt(index).getQuestion() != null)
            {
                FlashQuestion.Text = flash.getCardList().ElementAt(index).getQuestion();
            }

        }