Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to generate web service reference without INotifyPropertyChanged?
    primarykey
    data
    text
    <p>I am using <a href="http://visualstudiogallery.msdn.microsoft.com/074a2a26-d034-46f1-8fe1-0da97265eb7a" rel="noreferrer">Fody</a> in a SilverLight project to auto-generate property dependencies. However, it doesn't work if setters already contain a <code>RaisePropertyChanged</code> method call.</p> <p>A workaround could be to generate web service reference code without <code>INotifyPropertyChanged</code> and instead implement it in a partial method.</p> <p>How can I generate web service reference code without <code>INotifyPropertyChanged</code>?</p> <p>I have a WCF service, let's call it MaterialService.svc. It looks something like this:</p> <pre class="lang-cs prettyprint-override"><code>[ServiceContract] public interface IMaterialService { [OperationContract] Material GetMaterial(int id); } [DataContract] public class Material { [DataMember] public int ID { get; set; } [DataMember] public string Name { get; set; } } </code></pre> <p>When I add the service as a Service Reference and generate client code, every class is set to implement <code>INotifyPropertyChanged</code>:</p> <pre class="lang-cs prettyprint-override"><code>public partial class Material : object, System.ComponentModel.INotifyPropertyChanged { private int IDField; private string NameField; [System.Runtime.Serialization.DataMemberAttribute()] public int ID { get { return this.IDField; } set { if ((this.IDField.Equals(value) != true)) { this.IDField = value; this.RaisePropertyChanged("ID"); } } } [System.Runtime.Serialization.DataMemberAttribute()] public System.Nullable&lt;string&gt; Name { get { return this.NameField; } set { if ((this.NameField.Equals(value) != true)) { this.NameField = value; this.RaisePropertyChanged("Name"); } } } } </code></pre> <p>How can I generate client code that doesn't implement <code>INotifyPropertyChanged</code>?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload