|Then using events would be the logical way to go.
The reason the
get accessor is not called is because the
TreeView uses the
TreeNode type. Its
Text property is not virtual so the IL instruction
call is used, as opposed to
callvirt. Even if you hide it using the
new operator, this will not work because the
TreeView is using
call on the actual
TreeNode type. If you were to get the
Text property referencing your type (
DerivedNode), then your
get accessor would be called.
Microsoft MVP, Visual C#