Hey guys,
I have an object that I hold in a module so it is universally accessible in my app. This object has some events that I have handled by the use of AddHandler directives in a container control in my app. That’s been fine until now as I’ve only needed to use those events in that container control. I’ve just realized that in some cases, I want to temporarily change one of the event handlers to a method in a different container control.
I could easily use implicit calls to remove the handler from the first container control instance and add it to a second. However, I want to make it more OOP and not have to rely on the implicit path.
But I can’t Add a handler when one is already handled. I can’t remove a handler without having the path to the handler method. So how do I do this? Would an interface be a better way than raising events?
Thanks,
Jon