Attached event receiver.