Implement CustomEvent (#2173)