Share via


LostFocusEventManager.AddHandler 方法

定義

加入指定的事件處理常式,當指定的來源引發 LostFocusLostFocus 事件時,就會呼叫這個處理常式。

public:
 static void AddHandler(System::Windows::DependencyObject ^ source, EventHandler<System::Windows::RoutedEventArgs ^> ^ handler);
public static void AddHandler (System.Windows.DependencyObject source, EventHandler<System.Windows.RoutedEventArgs> handler);
static member AddHandler : System.Windows.DependencyObject * EventHandler<System.Windows.RoutedEventArgs> -> unit
Public Shared Sub AddHandler (source As DependencyObject, handler As EventHandler(Of RoutedEventArgs))

參數

source
DependencyObject

引發 LostFocusLostFocus 事件的來源物件。

handler
EventHandler<RoutedEventArgs>

處理 LostFocusLostFocus 事件的委派。

例外狀況

handlernull

備註

使用這個方法來指定您想要用來訂閱 UIElement.LostFocusContentElement.LostFocus 事件的事件處理常式。 當您使用此方法時,接聽程式物件不需要實作 IWeakEventListener 介面。

適用於