foreach (Graphic item in Map.Graphics) item.Selected = false;Instead you should get the feature layer firing the event and loop through the collection of graphics in that layer, i.e.
FeatureLayer layer = sender as FeatureLayer; foreach (Graphic item in layer.Graphics) item.Selected = false; this.Attributes.FeatureLayer = layer; // And the rest of your code ........
foreach (Layer layer in MyMap.Layers) { if (layer is FeatureLayer) { foreach (Graphic item in (layer as FeatureLayer).Graphics) item.Selected = false; } }