Full Site Version
Imports System
Imports System.Collections.Generic
Namespace Example
Class Base
Public Overridable Property Foo As String
Public Sub New()
Foo = "Hello world!"
End Sub
End Class
Class Derived
Inherits Base
MyBase.New()
Private ReadOnly Property History as List(Of String)
Get
Static _history As New List(Of String)
return _history
End Get
end Property
Public Overrides Property Foo As String
Return MyBase.Foo
Set(ByVal value As String)
History.Add(value)
MyBase.Foo = value
End Set
End Property
Public Sub PrintHistory()
History.ForEach(sub(f) Console.WriteLine(f))
Public Class Program
Public Shared Sub Main()
Dim b = New Derived()
b.Foo="bye"
b.PrintHistory()
End Namespace