using System;
using System.Collections.Generic;
namespace Example
{
class Base
public virtual string Foo { get; set; }
public Base()
Foo = "Hello world!";
}
class Derived : Base
List<string> _history;
public Derived() : base()
_history = new List<string>();
public override string Foo
get
return base.Foo;
set
_history.Add(value);
base.Foo = value;
public class Program
public static void Main()
var b = new Derived();
Console.WriteLine(b.Foo);