As @Clemens points out, the correct way to add an event handler is to override the appropriate On<handler name> method in the code behind.