2006/11/29

lambda and property

if a property is bound to a specific method instance in a base class, and a derived method overrides the method, the property still remains bound to the original base class method.

Thus, we would have to also override the property in the derived class in order to get the desired behavior.


By binding the property to a lambda function that calls the desired method, when the method is overridden in a derived class, the property need not also be overridden in that derived class.

沒有留言:

張貼留言