Export (0) Print
Expand All

RoutedEventArgs.OriginalSource Property

Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

'Declaration
Public ReadOnly Property OriginalSource As Object
'Usage
Dim instance As RoutedEventArgs
Dim value As Object

value = instance.OriginalSource

/** @property */
public Object get_OriginalSource ()

public function get OriginalSource () : Object

Members of this class are either not typically used in XAML, or cannot be used in XAML.

Property Value

The original reporting source, before any possible Source adjustment made by class handling, which may have been done to flatten composited element trees.

This property acquires its value once, before the class event handlers or any instance handlers are invoked, and is never adjusted past this point. The original source information is read-only to class handlers or class implementations, just as it is reported in the event data.

Common cases where the source may be adjusted include content elements inside a content model for a control (the contents of a list item, for instance, will report the list item element as the Source and the actual element within the list item will be the OriginalSource.

Source adjustment by various elements and content models varies from class to class. Each class that adjusts event sources attempts to anticipate which source is the most useful to report for most input scenarios and the scenarios for which the class is intended, and then sets that source as the Source. If this source is not the one that has relevance to your handling of the event, try checking OriginalSource instead to see if it reports a different source that is more suitable. For more details on input events, see Input Overview.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft