Beginner in C# here. I was wondering if the following is even possible in c#.
I have the following code that works (but does not do much as of now):
while (i != 10)
{
i++;
_playerCard1.Source = new BitmapImage(new Uri($"ms-appx:///Assets/card {cardsInHand[cardsInHand.Count - 1].Face}.gif"));
}
Now I have other Image fields in my program named _playerCard2, _playerCard3 and so on. What I wanted to know was if I could have the while loop iterate through the different Image fields using the i variable. Something like this:
while (i != 10)
{
i++;
_playerCard{i}.Source = new BitmapImage(new Uri($"ms-appx:///Assets/card {cardsInHand[cardsInHand.Count - 1].Face}.gif"));
}
I know the above code will not work, just wondering if it even is possible and if so how would I code it? Thank you for all your help!