共用方式為


Keyboard.AddPreviewGotKeyboardFocusHandler 方法

定義

加入 PreviewGotKeyboardFocus 附加事件的處理常式。

public:
 static void AddPreviewGotKeyboardFocusHandler(System::Windows::DependencyObject ^ element, System::Windows::Input::KeyboardFocusChangedEventHandler ^ handler);
public static void AddPreviewGotKeyboardFocusHandler (System.Windows.DependencyObject element, System.Windows.Input.KeyboardFocusChangedEventHandler handler);
static member AddPreviewGotKeyboardFocusHandler : System.Windows.DependencyObject * System.Windows.Input.KeyboardFocusChangedEventHandler -> unit
Public Shared Sub AddPreviewGotKeyboardFocusHandler (element As DependencyObject, handler As KeyboardFocusChangedEventHandler)

參數

element
DependencyObject

接聽這個事件的 UIElementContentElement

handler
KeyboardFocusChangedEventHandler

要加入的事件處理常式。

備註

這個方法提供附加屬性存取子,以便存取附加事件的程式代碼和 XAML 屬性處理 Keyboard.PreviewGotKeyboardFocus

適用於