I have the following code that is the addrange method:
foreach (var graphic in buffersList)
{
if (!graphicsLayerHeat.Graphics.Contains(graphic))
{
graphicsLayerHeat.Graphics.AddRange(buffersList);
}
}
But the visual studio prompts me this error
'ESRI.ArcGIS.Client.GraphicCollection' does not contain a definition for 'AddRange' and no extension method 'AddRange' accepting a first argument of type 'ESRI.ArcGIS.Client.GraphicCollection' could be found (are you missing a using directive or an assembly reference?)
How can I change the method so that it can work the same way without using addrange?
Change this
graphicsLayerHeat.Graphics.AddRange(buffersList);
to this:
graphicsLayerHeat.Graphics.Add(graphic);
I assume you don't want to add the bufferlist
over and over again (as the other answerer's solution would do).
The newer version of the ESRI silverlight API does have an AddRange
method (time to update?), but I don't think that's what you want to use since you also want to do the contains check.