FrameworkContentElement.OnToolTipOpening(ToolTipEventArgs) 方法

定義

ToolTipOpening 路由事件到達其路由中的這個類別時,便會叫用此方法。Invoked whenever the ToolTipOpening routed event reaches this class in its route. 實作這個方法可為此事件加入類別處理。Implement this method to add class handling for this event.

protected:
 virtual void OnToolTipOpening(System::Windows::Controls::ToolTipEventArgs ^ e);
protected virtual void OnToolTipOpening (System.Windows.Controls.ToolTipEventArgs e);
abstract member OnToolTipOpening : System.Windows.Controls.ToolTipEventArgs -> unit
override this.OnToolTipOpening : System.Windows.Controls.ToolTipEventArgs -> unit
Protected Overridable Sub OnToolTipOpening (e As ToolTipEventArgs)

參數

e
ToolTipEventArgs

提供有關事件的資料。Provides data about the event.

備註

這個方法沒有預設的實值。This method has no default implementation. 您仍應呼叫 base (),以防繼承中的中繼類別已實作為此方法。You should still call base() in case an intermediate class in the inheritance has implemented this method.

這個方法的目的與 * 方法上 通用語言執行平台 (CLR)common language runtime (CLR) 事件模式有點類似:它提供的方法是使用類別處理常式(而非實例處理常式)來處理衍生類別中的比對事件。The purpose of this method is somewhat similar to 通用語言執行平台 (CLR)common language runtime (CLR) event pattern On* methods: it provides the means to handle the matching event from derived classes with a class handler instead of an instance handler. 在此情況下,比對事件是路由事件。In this case the matching event is a routed event. 因為路由事件可能是由子項目引發,而不一定是將叫用處理程式的專案,因此,您的執行必須接受事件引數的來源,而對路由事件而言,的執行模式會不同。將屬性納入考慮(而且在大部分情況下都不應該嘗試重新引發事件)。The implementation pattern of the On* methods is different for routed events because the routed event may have been raised by a child element, not necessarily the element that will invoke handlers, so your implementation will need to take the event arguments' source properties into account (and should not try to re-raise the event in most cases). FrameworkContentElement 的子類別可以選擇在路由收到事件時,呼叫私用類別處理常式方法。Subclasses of FrameworkContentElement could choose to call private class handler methods when the event is received along the route. 其中一個可能的案例是接受事件的引數,並故意將事件標示為已處理,以縮短路由。One potential scenario is to take the arguments of the event and deliberately mark the event as handled to shorten the route.

適用於