Allows you to register event handlers on class base.