title: Abstract fields in C# - adding set in a child class
body: <p>I am running into an issue with field inheritance.  First I will explain how I would like it to work, and then ask for suggestions on how I can change the syntax to do what I want.</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>public abstract class A
  {
      public abstract D D1
      {
          get;
      }
  
      protected D _d2;
      public virtual D D2
      {
          get { return _d2; }
          set { _d2 = value; }
      }
  }
  
  public abstract class B : A
  {
      protected D _d1;
      public override D D1
      {
          get { return _d1; }
          set
          {
              _d1 = value;
              Update();
          }
      }
  }
  
  public abstract class C : A
  {
      public override D D1
      {
          get
          {
              return _d2.Find1();
          }
      }
  
      public override D D2
      {
          get { return base.D2; }
          set
          {
              base.D2 = value;
              Update();
          }
      }
  }
  </code></pre>
  
  <p>The problem is that A doesn't compile because it can't find an method to override with D1's set.  This how I expected it to work:</p>
  
  <pre><code>A ab = new B();
  print(ab.D1);
  ab.D1 = 4; // I would expect a compiler error
  ((B)ab).D1 = 4; // I would expect a compiler error
  
  A ac = new C();
  print(ac.D1);
  ac.D1 = 4; // I would expect a compiler error
  ((C)ac).D1 = 4; // **I would expect this to work**
  </code></pre>
  
  <p>One solution I can see would be to add "set;" to A1's D1 and throw a NotImplementedException if I try to use it in C, but that would prevent the issue from showing up in the compiler.  Anyone know of a way around this issue?  I would really like to keep them as fields so that I can display them using WPF.</p>