C # serialization and event for data binding are lost

I already posted something similar here , but I would like to ask a more general question here.

Try serializing an object that implements INotifyPropertyChanged and returning it from serialization and binding it to a DataGridView? When I do this, I have no update on the value that changes (I need to minimize the windows and open it).

Do you have a trick

+3
source share
3 answers

Use DataContractSerializerand create the OnDeserialized method

[OnDeserialized]
private void OnDeserialized(StreamingContext c) {}

This will allow you to raise the PropertyChanged event when deserialization is complete.

+2
source

, , , ...

0

Serializing interfaces becomes difficult when you are dealing with objects that have internal states. Can you post the sample serialization code you are talking about?

0
source

Source: https://habr.com/ru/post/1697398/


All Articles