title: C# Accessing properties of a parent class from derived classes
body: <p>I have a class named <code>PINPAD</code>, a base class named <code>Devices</code>, and two derived classes named <code>DevA</code> and <code>Dev B</code></p>
  
  <p>The issue is that the main class property <code>PINPAD.Status</code> needs to be updated from classes <code>DevA</code> and <code>DevB</code></p>
  
  <p>Here is the code:</p>
  
  <pre><code>public class CALLER()
  {
    CALLER()
    {
      PINPAD PINPD = new PINPAD("A");
      //....
      MessageBox.Show(PINPD.Status);
    }
  }
  
  public class PINPAD()
  {
      public Devices MyDev = null;
      public string Status = "";
  
      public PINPAD(string Model)
      {
          if (Model = "A")
          {
              DevA MyDev = new DevA()
          }
          else
          {
              DevB MyDev = new DevB()
          }
  
          MyDev.DoWork();
      }
  }
  
  public class Devices
  {
      public virtual void DoWork() {}
  }
  
  public class DevA : Devices
  {
      public override void DoWork() { }
  
      DevA()
      {
          PINPAD.Status = "Broken";
          //Status not avialable!
      }
  }
  
  public class DevB : Devices
  {
      public override void DoWork() { }
  
      DevB()
      {
          PINPAD.Status = "Working!";
          //Status not avialable!
      }
  }
  </code></pre>