title: How to get value of inherited property using reflection?
body: <p>How to get inherited property value using reflection? 
  I try with <code>BindingFlags</code> but still trigger <code>NullReferenceException</code></p>
  
  <pre><code>object val = targetObject.GetType().GetProperty("position", BindingFlags.FlattenHierarchy).GetValue(targetObject, null);
  </code></pre>
  
  <p><code>position</code> is iherited public property and has a declared value. </p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>class myParent
  {
      public float[] position;
      public myParent()
      {
          this.position = new float[] { 1, 2, 3 };
      }
  }
  
  class myChild : myParent
  {
      public myChild() : base() { }
  }
  
  myChild obj = new myChild();
  PropertyInfo p = obj.GetType().GetProperty("position", BindingFlags.Instance | BindingFlags.Public); 
  </code></pre>
  
  <p>I tried with several combinations with BindingFlags but <code>p</code> always is null :( , </p>