I have a thread safe implementation of the ObservableCollection that locks when adding, removing and firing the CollectionChanged event (in case a listener would like to iterate it).Now I'm wondering, if XamChart that binds to this collection through a Series object migth initiate an enumeration without recieving the CollectionChanged event, iterating it without locking it.Is there a way to make sure this doesn't happen, or do I have to implement the IEnumerable interface myself, and return the enumerator of a copy of the collection in the GetEnumerator method.Troels
the xamchart will certainly enumerate through your collection during databinding. it won't modify it, though.
i don't know of any pattern to sync lock enumeration, since even if you implement IEnumerable and IEnumerator, you still don't know when the caller has started, finished, or broken out of the loop.