OriginalSource Property
Collapse the table of content
Expand the table of content

RoutedEventArgs.OriginalSource Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets a reference to the object that raised the event.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public Object OriginalSource { get; internal set; }

Property Value

Type: System.Object
The object that raised the event.

For any bubbling routed event that has actually traveled the route beyond the element that raised it, and for any tunneling routed event that has not yet tunneled down to the element that raised it, the value of OriginalSource will be different than the value of the sender parameter of the event handler signature. Which of the two elements involved in the event is of the most importance in any given handler (OriginalSource, the element that raised it, or sender, the element that is currently handling it) is dependent on the application logic that your handler is addressing. For example, control compositing is often interested in OriginalSource, whereas usage of existing control instances in applications is generally only interested in sender unless the application's UI structure also uses event routing and a deliberately nested composition structure to "forward" input events.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft