Tuesday, 21 October 2008


We've had a problem with classes that implement this interface failing to serialize. The solution would appear to be this attribute:


public event PropertyChangedEventHandler PropertyChanged;
That attribute prevents the delegate field which the compiler emits to implement the PropertyChanged event from being serialized. Since a delegate internally stores hard references to its listeners, you need to prevent that delegate from being serialized. If the delegate were serialized then it would attempt to serialize the objects to which it points.

No comments: