Hello.I'm messing around some and trying things out. One thing I'd like to be able to do is to display a number of symbols, and move them around while the application is running.I've tried implementing this idea with the following code, it doesn't work with the obvious symptom being that the symbols doesn't move. If there's any questions regarding the code I'll gladly answer any questions. private void button2_Click(object sender, RoutedEventArgs e)
{
graphicsLayer = new GraphicsLayer();
symbolList_ = new List<ESRI.ArcGIS.Client.Geometry.MapPoint>();
r = new Random();
for (int i = 0; i < NUM_SYMBOLS; ++i)
{
symbolList_.Add(new ESRI.ArcGIS.Client.Geometry.MapPoint()
{ SpatialReference = defaultSpatialReference,
X = 0,
Y = 0,
});
graphicsLayer.Graphics.Add(new ESRI.ArcGIS.Client.Graphic()
{
Geometry = symbolList_,
Symbol = s,
});
}
_mapControl.Layers.Add(graphicsLayer);
TimerCallback tcb = this.SymbolUpdater;
System.Threading.Timer t = new System.Threading.Timer(tcb, null, 1000, Timeout.Infinite);
}
public void SymbolUpdater(Object o)
{
while (true)
{
foreach (ESRI.ArcGIS.Client.Geometry.MapPoint mp in symbolList_)
{
mp.X += getRandom();
mp.Y += getRandom();
}
}
}
private double getRandom()
{
double d = r.NextDouble();
if (r.NextDouble() > 0.5)
{
return d;
}
else
return -d;
}
}Help is much appreciated. 🙂Maybe this post could've gone into this thread: http://forums.arcgis.com/threads/48369-Graphics-Layer-inaccessible-by-background-threadI apologize for any inconvenience if so.