Prev | Current Page 308 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

Properties of the RoutedEventArgs Class
Name Description
Source Indicates what object raised the event. In the case of a keyboard event, this is
the control that had focus when the event occurred (for example, when the key
was pressed). In the case of a mouse event, this is the topmost element under
the mouse pointer when the event occurred (for example, when a mouse
button was clicked).
OriginalSource Indicates what object originally raised the event. Usually, the OriginalSource is
the same as the source. However, in some cases the OriginalSource goes deeper
in the object tree to get a behind-the-scenes element that??™s part of a higherlevel
element. For example, if you click close to the border of a window, you??™ll
get a Window object for the event source, but a Border object for the original
source. That??™s because a Window is composed out of individual, smaller
components. To take a closer look at this composition model (and learn how to
change it), head to Chapter 15, which discusses control templates.
RoutedEvent Provides the RoutedEvent object for the event triggered by your event handler
(such as the shared UIElement.MouseUpEvent object). This information is
useful if you??™re handling different events with the same event handler.
Handled Allows you to halt the event bubbling or tunneling process.


Pages:
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320