Implements event binding.