G
Guest
Can anyone tell me how to access a variable in a parent class from within a nested class?
Note: this snippet is only to illustrate my problem... I realize there's no need to get at the parent name THROUGH the child object, but it quickly shows what I'm after... any help would be appreciated. THANKS IN ADVANCE!
see example....
Public Class Parent
Private mParentName As String
Private mChild As Child
Public ReadOnly Property Name() As String
Get
Return mChild.ParentName
End Get
End Property
Sub New()
mParentName = "parent name test"
mChild = New Child
End Sub
Private Class Child
Public ReadOnly Property ParentName() As String
Get
'how can the child object be innately aware
'of a property of its parent object???
Return "???"
End Get
End Property
Friend Sub New()
MyBase.New()
End Sub
End Class
End Class
Note: this snippet is only to illustrate my problem... I realize there's no need to get at the parent name THROUGH the child object, but it quickly shows what I'm after... any help would be appreciated. THANKS IN ADVANCE!
see example....
Public Class Parent
Private mParentName As String
Private mChild As Child
Public ReadOnly Property Name() As String
Get
Return mChild.ParentName
End Get
End Property
Sub New()
mParentName = "parent name test"
mChild = New Child
End Sub
Private Class Child
Public ReadOnly Property ParentName() As String
Get
'how can the child object be innately aware
'of a property of its parent object???
Return "???"
End Get
End Property
Friend Sub New()
MyBase.New()
End Sub
End Class
End Class