In principle, this is one and the same event, but occurs right before the main event. They exist, so you can listen to those types of events without interfering with the normal behavior of the control when these events occur.
For example, buttons do something when pressed or MouseEnter, etc. If you handle these events yourself, you must make sure that you do the same, otherwise your button will not act the same. Preview events provide you with an event on the same timeline without worrying about messing with existing functionality.
This is especially useful when working with custom styles / triggers / control patterns. When you start to cancel the appearance / behavior of the control.
So, in your control, do the basic work you want in the OnKeyDown event, and leave a preview event for someone else how I work with them.
Nick Sep 22 '09 at 13:43 2009-09-22 13:43
source share