70-511 · Question #235
70-511 Question #235: Real Exam Question with Answer & Explanation
The correct answer is B. Programmatically add an event handler to the parent control and set the HandledEventsToo. For most common handler scenarios, marking an event as handled by setting Handled to true will "stop" routing for either a tunneling route or a bubbling route, and also for any event that is handled at a point in the route by a class handler. However, there is a "handledEventsToo
Question
Options
- AAdd a bubbling routed event handler to the parent control.
- BProgrammatically add an event handler to the parent control and set the HandledEventsToo
- CAdd a tunneling routed event handler to the parent control.
- DProgrammatically add an event handler to the parent control and set the HandledEventsToo
Explanation
For most common handler scenarios, marking an event as handled by setting Handled to true will "stop" routing for either a tunneling route or a bubbling route, and also for any event that is handled at a point in the route by a class handler. However, there is a "handledEventsToo" mechanism whereby listeners can still run handlers in response to routed events where Handled is true in the event data. In other words, the event route is not truly stopped by marking the event data as handled. You can only use the handledEventsToo mechanism in code, or in an EventSetter:
Community Discussion
No community discussion yet for this question.