title: VB.Net and access via a variable of an interface type
body: <p>How do I make the properties of a class available in an inheriting class, for a variable that is declared to be the type of one of the interfaces implemented by that class?</p>
  
  <p>What I have done so far is to create an abstract class <code>MyAbstract</code> with the keyword MustInherit and in the inheriting class <code>MyInheritingClass</code> I have added inherits and then the name of the abstract class. Now this is all fine, but in my inheriting class, if I create an interface on that class <code>MyInterface</code> and use that interface elsewhere in my code, I have then found that I cannot see the properties from my abstract class, on the variable declared with that interface.</p>
  
  <p>Am I doing something wrong here, or is there something else that I need to do?</p>
  
  <p>An example would be as follows:</p>
  
  <pre><code>Public MustInherit Class MyAbstract
      Private _myString as String
      Public Property CommonString as String
          Get
              Return _myString
          End Get
          Set (value as String)
              _myString = value
          End Set
      End Property
  End Class
  
  Public Class MyInheritingClass
      Inherits MyAbstract
      Implements MyInterface
  
      Sub MySub(myParameter As MyInterface)
          myParameter.CommonString = "abc" ' compiler error - CommonString is not a member of MyInterface.
      End Sub
  
      'Other properties and methods go here!'
  End Class
  </code></pre>
  
  <p>So, this is what I am doing, but when I use <code>MyInterface</code>, I cannot see the properties of my Abstract Class!</p>