Welcome to the world of inheritance...and there are a number of ways to go about this. We actually have a section in training where we talk about this. The situation that you are dealing with is ideal for interfaces. Basically you need to move something up the food chain. So you either need to move classes further upstream...or create interfaces that are further upstream and then implemented on the classes. Then to prevent the circular reference, you type instance references that you are fighting as the interface instead of the actual class.
The Interface
Public Interface MyInterface
''' <summary>
''' Define properties
''' </summary>
Property IsReady() As Boolean
''' <summary>
''' Define methods
''' </summary>
Function Execute() As Boolean
End Interface
The Class
Public Class MySampleClass
Implements MyInterface
''' <summary>
''' Implement the execute method from the interface
''' </summary>
Public Function Execute() As Boolean Implements MyInterface.Execute
'-- Do something here
End Function
''' <summary>
''' Define the property and implement the IsReady property of the interface
''' </summary>
''' <remarks></remarks>
Private _IsReady As Boolean = False
Public Property IsReady() As Boolean Implements MyInterface.IsReady
Get
Return _IsReady
End Get
Set(ByVal value As Boolean)
_IsReady = value
End Set
End Property
End Class
Typing the Class as an Interface
''' <summary>
''' This class will accept the interface instead of the object instance
''' </summary>
Public Class AnotherTestClass
Public Sub TestingInterface(ByVal e As MyInterface)
'-- Use the interface
If e.IsReady Then e.Execute()
End Sub
End Class
Using the Interface Instead of the Instance
Public Class FinalTest
Public Sub FinalTest()
Dim x As New AnotherTestClass()
Dim y As New MySampleClass()
x.TestingInterface(y)
End Sub
End Class