wpf - What are routed events and how it's different from normal events -


I appreciate if some body can explain with a simple example.

Imagine a window that has a dense hierarchy of hair control. Now we say that you want to do something, there is a right click anywhere in your window.

  • With normal events, you have to handle one click event for all the controls, because you are not sure where the user can click on
  • WPF Together, events are either "bubble" or "tunnel" (i.e. u.iii travels towards the tree or bottom) if they do not find an event handler, which it "handles" at the current level. You can write a handler for the event of the window i.e. TopLevel (Add event to WPF, Preview preview of XXX and XXX - Preview shows the XXX event first and controls the tunnel below the root, which receives excitement and is equivalent to XXX events, then returning from hair control Bubbles up to root) . So if you click on the right button, the WPF visits the UI hierarchy, in which all the handlers are invented, which finds it (unless it marks an event, the "handled" Is.)

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -