Applied dispatchEvent() method.
Merge pull request #4566 from robertpustulka/3.0-dispatch-refactoring

3.0: Applying dispatchEvent()