Routed events come in the following three flavors


Direct events
These are like ordinary .NET events. They originate in one element and don’t pass to any other. For example, MouseEnter (which fires when the mouse pointer moves over an element) is a direct event.

Bubbling events
These events travel up the containment hierarchy. For example, MouseDown is a bubbling event. It’s raised first by the element that is clicked. Next, it’s raised by that element’s parent, then by thatelement’s parent, and so on, until WPF reaches the top of the element tree.

Tunneling events
These events travel down the containment hierarchy. They give you the chance to preview (and possibly stop) an event before it reaches the appropriate control. For example, PreviewKeyDown allows you to intercept a key press, first at the window level and then in increasingly more-specific containers until you reach the element that had focus when the key was pressed. 
Tunneling events are useful if you need to perform some preprocessing that acts on certain keystrokes or filters out certain mouse actions.



Most WPF elements don’t expose a Click event. Instead, they include the more straightforward MouseDown and MouseUp events. Click is reserved for button-based controls.

댓글

이 블로그의 인기 게시물

Oracle NLS_DATE_FORMAT 변경

Stop console process using Ctrl+C.

Alternative to IValueConvert, QuickConverter