Search code examples
c#.netsilverlightwcfwcf-binding

OnPropertyChanged Event in WCF DataContract


I'm fairly new to WCF implementations and I'm having difficulties with some databinding. Namely, I have 2 radio buttons inside my silverlight application (the properties are bound to properties inside one of my data contracts). I also have a masked text box that changes based on the radio button selected. The "Masked Textbox"'s text is bound to another property of the data contract of the WCF.

My thought process was to implement the "INotifyPropertyChanged" interface on the data contract and use the "OnPropertyChanged" event that would trigger the masked textbox to change its "mask" based on the radio button selected. Well this hasn't worked out so well as i'm unable to get the OnPropertyChanged event working properly from the WCF.

Do you guys have any workarounds to this hopefully trivial problem?

Thank you so much in advance, -Tom


Solution

  • I got what I needed by creating a wrapper class on the client side (that extended the WCF's data contract). I then implemented the INotifyPropertyChanged interface on this wrapper class. It might not be the prettiest workaround but it gets the job done.