I have a collection of graphics, I've added an attribute called "Id" for each graphic.
What would be the best way to find a graphic by its Id?
Do I have to iterate all the collection?
Something like this should work ....
var graphics = new GraphicCollection();
graphics = // your code here
int interestingId = 1;
var interestingGraphic = graphics.FirstOrDefault( g => (int) g.Attributes["Id"] == interestingId);