silverlight - How to initialize local fields of a WCF proxy class on deserialization -


in silverlight client have partial class created setting wcf reference. i've extended class adding few relaycommand properties. need initialize these properties in constructor. seems constructor not being called, believe result of of vts i'm unsuccessful in using ondeserialized attribute.

what prescribed way initialize client side data members of wcf class.

i've created sample project , works expected. if code doesn't - post data contract , client code.

namespace silverlightapplication3.servicereference1 {     public partial class somemodel     {         public string extendedproperty { get; set; }          [ondeserializing]         public void ondeserializingmethod(streamingcontext context)         {             this.extendedproperty = "ok";         }     } } 

service method call:

var proxy = new servicereference1.service1client(); proxy.doworkcompleted += (s,e) => debug.writeline(e.result.extendedproperty); //ok proxy.doworkasync(); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -