다음을 통해 공유


TraversalRequest(FocusNavigationDirection) 생성자

정의

TraversalRequest 클래스의 새 인스턴스를 초기화합니다.

public:
 TraversalRequest(System::Windows::Input::FocusNavigationDirection focusNavigationDirection);
public TraversalRequest (System.Windows.Input.FocusNavigationDirection focusNavigationDirection);
new System.Windows.Input.TraversalRequest : System.Windows.Input.FocusNavigationDirection -> System.Windows.Input.TraversalRequest
Public Sub New (focusNavigationDirection As FocusNavigationDirection)

매개 변수

focusNavigationDirection
FocusNavigationDirection

원하는 포커스 이동 방향으로 열거형 값입니다.

예제

다음 예에서는 TraversalRequest 에 대 한 입력으로 인스턴스를 FrameworkElement.MoveFocus 호출 합니다.

// Creating a FocusNavigationDirection object and setting it to a
// local field that contains the direction selected.
FocusNavigationDirection focusDirection = _focusMoveValue;

// MoveFocus takes a TraveralReqest as its argument.
TraversalRequest request = new TraversalRequest(focusDirection);

// Gets the element with keyboard focus.
UIElement elementWithFocus = Keyboard.FocusedElement as UIElement;

// Change keyboard focus.
if (elementWithFocus != null)
{
    elementWithFocus.MoveFocus(request);
}
' Creating a FocusNavigationDirection object and setting it to a
' local field that contains the direction selected.
Dim focusDirection As FocusNavigationDirection = _focusMoveValue

' MoveFocus takes a TraveralReqest as its argument.
Dim request As New TraversalRequest(focusDirection)

' Gets the element with keyboard focus.
Dim elementWithFocus As UIElement = TryCast(Keyboard.FocusedElement, UIElement)

' Change keyboard focus.
If elementWithFocus IsNot Nothing Then
    elementWithFocus.MoveFocus(request)
End If

적용 대상

추가 정보