SerializationException when serializing instance of a class which implements INotifyPropertyChanged

前端 未结 1 494
故里飘歌
故里飘歌 2020-12-15 18:42

i am trying to serialize a field of my class. Withou it serialization is fine, with it a get SerializationException.

Field is : private readonly ObservableColl

相关标签:
1条回答
  • 2020-12-15 19:40

    Try out marking event PropertyChanged by [NonSerialized] attribute

    below is syntax for events: (see MSDN)

    [field:NonSerializedAttribute()] 
    public event ChangedEventHandler Changed;
    
    0 讨论(0)
提交回复
热议问题