FrameworkElement.OnToolTipOpening(ToolTipEventArgs) FrameworkElement.OnToolTipOpening(ToolTipEventArgs) FrameworkElement.OnToolTipOpening(ToolTipEventArgs) FrameworkElement.OnToolTipOpening(ToolTipEventArgs) Method

定義

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 ToolTipEventArgs ToolTipEventArgs ToolTipEventArgs

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

備註

這個方法沒有任何預設實作。This method has no default implementation. 如果在繼承的中繼類別已實作此方法,您仍應該呼叫基底實作。You should still call the base implementation 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. On * 方法的實作模式是不同的路由事件,因為路由的事件可能已引發由子項目,不一定會叫用處理常式,因此您的實作必須接受事件引數的來源項目帳戶屬性 (和不應該嘗試重新引發該事件,在大部分情況下)。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). 子類別FrameworkElement可以選擇在路由收到事件時呼叫私用類別處理常式方法。Subclasses of FrameworkElement 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.

適用於