Moving theme switching event callback to core.