views:

147

answers:

1

I have my class that has an internal observable collection. I want to pass the data in this to a user of the class via a function.

I don't want them to be able to change the objects inside of the observable collection or the collection itself.

What is the best way to do this performance and ease of use wise?

+1  A: 

Probably using this: ReadOnlyObservableCollection<T>. Note that you will have to write your own read-only wrappers for your objects, since the ReadOnlyObservableCollection<T> only prevents updates to the collection itself.

Stephen Cleary