views:

583

answers:

3

Hello, I have already posted something similar here but I would like to ask the question more general over here.

Have you try to serialize an object that implement INotifyPropertyChanged and to get it back from serialization and to bind it to a DataGridView? When I do it, I have no refresh from the value that change (I need to minimize the windows and open it back).

Do you have any trick?

A: 

The trick of having it's own Event and binding it after serialization works but is not elegant because require an other event that I would not like to have...

Daok
A: 

Serializing interfaces gets tricky when you deal with objects that have internal states. Can you post an example of the serialization code you're talking about?

The problem is that the object inherit from object that inherit from other object. All is very huge to display. I'll try to make a short example soon.
Daok
+2  A: 

Use the DataContractSerializer and create a method for OnDeserialized

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

This will let you raise the PropertyChanged event when deserialization is complete

Scott Weinstein
+1: Serialization can be a pain. This really helped me out.
Benny Jobigan