[field:NonSerialized]
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.
12 years ago
No comments:
Post a Comment