RoutedEventArgs.OriginalSource RoutedEventArgs.OriginalSource RoutedEventArgs.OriginalSource RoutedEventArgs.OriginalSource Property

定義

在父類別進行任何可能的 Source 調整之前,取得純點擊測試所判定的原始報告來源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

public:
 property System::Object ^ OriginalSource { System::Object ^ get(); };
public object OriginalSource { get; }
member this.OriginalSource : obj
Public ReadOnly Property OriginalSource As Object

屬性值

可能已扁平化複合項目樹狀結構的原始報告來源 (在類別處理進行任何可能的 Source 調整之前)。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.

可能會調整來源的常見情況包括控制項內容模型內的內容專案 (例如, 清單專案的內容), 會將清單專案元素報告為Source , 而清單專案中的實際專案將會是OriginalSource.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. 每個調整事件來源的類別都會嘗試預期哪一個來源最適合用來針對大部分的輸入案例和類別的預期案例進行報告, 然後將該來源設定為SourceEach 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. 如果此來源不是與您的事件處理相關的來源, 請嘗試改為檢查OriginalSource它是否報告了更適合的不同來源。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.

適用於

另請參閱