I have a class witch implements INotifyPropertyChanged. How do I send that through WCF
When eventhandlers are hooked I get:
“Error while trying to serialize parameter http://tempuri.org/:customer. Type 'System.Windows.PropertyChangedEventManager' has neither Serializable attribute nor DataContract attribute”
Best regards,
Thomas Andersen

WCF and objects with events
raj more
WCF sends only data part of the class. In order to send a class through WCF the class must have either DataContract or Serializable attribute. (You can find more information about WCF serialization programming model here)
The recommended practice in Service Oriented Architecture is to define the data you want to send as DataContract and keep the eventing behavior local. Translated in plain english, you need to mark only the data members (and not events) with DataMember attribute.
You could use the class with events on both sides and thus get the eventing behavior. However the events are not sent across.
I hope this helps.
Steve of Easyget.biz
The class is marked Serializable, but I can't mark the event NonSerialized
"Error 21 Attribute 'NonSerialized' is not valid on this declaration type. It is valid on 'field' declarations only."
Does this mean I have to change to DataContract and then mark all the DataMembers
BTW, if I remove the "event" keyword I can mark it "NonSerialized", but then it doesn't implement INotifyPropertyChanged witch I need for WPF databinding.
Best regards,
Thomas S. Andersen
Aengus O