Use the Disconnected event.