I am writing a Silverlight application. How do I generate 2 pictures from an array of images and display it on my screen?
This is what I have now.
private void PopulateCards(object sender, RoutedEventArgs e)
{
List<string> Level2 = new List<string> { "1", "2", "3" };
List<string> randomizedImageList = GetRandomList(Level2);
for (int i = 0; i < randomizedImageList.Count; i++)
{
Picture currentCard = PictureGrid.Children[i] as Picture;
currentCard.MouseLeftButtonUp += new MouseButtonEventHandler(CardClicked);
currentCard.Tag = randomizedImageList[i];
currentCard.photo.Source = new BitmapImage(new Uri("/LogIn;Component/Image/" + randomizedImageList[i] + ".jpg", UriKind.Relative));
}
}