My colleague and I chatted about overclocked events, and we came up with some things that did not make much sense. First of all, what is the purpose of the Direct event, and why are there direct events LeftMouseButtonDown and PreviewLeftMouseButtonDown , rather than bubbling and tunneling, respectively?
According to the documentation, LeftMouseButtonDown events (and previews) seem to behave like bubble and tunnel events, except that the event rises and re-raises when these events cross the tree. Since direct events can be processed only by the event source, it follows that any UIElement can handle a direct event, since each of them raises an event and, therefore, is a source. (If reraising an event is no different from raising?). Why then do they not tunnel and bubble like so many other similar events?
Neither my colleague nor I could come up with a usage example in which we ever created a custom event using a direct strategy (although we came up with some for tunneling and bubbling), but LeftMouseButtonDown , one of the most common events (if not the most common) use this strategy.
Anyone have any ideas about this rational?
Thanks!
source share