In summary, How to filter the features in a graphics layer? I only want graphics in the current extent to be written to the xml.
var graphicsInCurrentExtent = graphicsLayer.Graphics.Where(g => g.Geometry.Extent.Intersects(MyMap.Extent)).ToList();
Something like:var graphicsInCurrentExtent = graphicsLayer.Graphics.Where(g => g.Geometry.Extent.Intersects(MyMap.Extent)).ToList();
Thanks for the quick reply. However, there is no "Where" property to the Graphics on the above code line. I am still struggling to find a method to filter a graphics layer, so any pointers will be useful.
'Where' is a .net LINQ method (documentation). To enable it, add : 'using System.Linq' at the beginning of your C# file.