Allow the event dispatcher to be injected.