Click here to Skip to main content
16,012,223 members

Comments by SteveBaldwin21 (Top 30 by date)

SteveBaldwin21 15-Sep-13 15:18pm View    
The problem I see is the collection modified during enumeration when adding the new images.
SteveBaldwin21 18-Aug-13 18:27pm View    
Haha. An Asynchronous operation then.:)
SteveBaldwin21 12-Aug-13 8:54am View    
<pre lang="cs">for (int i = 0; i < PlantCount; i++)
{

_PlantCollection.Add(new PlantCollection()
{
Name = _ListOfPlantNames[i],
URLOfPlant = ListOfURLs()[i],
PlantThumbnail = new BitmapImage(new Uri(ListOfImageSources()[i])),
SafeToFeed = ListOfSafeText()[i],
PlantTrafficColour = ListOfTrafficColours()[i]
});
}</pre>

<pre>PlantListView.ItemsSource = _PlantCollection;</pre>

^^ My listview that displays the plants in the UI.

If the PlantCount is null/0/empty - no items are shown in the Listview. If no Listview items are shown this is an indication that the PlantCount has 0 as a value in the loop, because if I add a value instead of the PlantCount it works as intended.

Hope this makes sense?
Thank you.
SteveBaldwin21 12-Aug-13 8:46am View    
This answer worked. Thank you very much David.
SteveBaldwin21 12-Aug-13 8:37am View    
I see on my question I had wrote the return inside the loop, my apologies as this was not in my code. This happened when I was trying to adjust the formatting in the "<pre>" section. I will try the code below and thank you!.