This documentation is archived and is not being maintained.

TraversalRequest Class

Represents a request to move focus to another control.

Namespace: System.Windows.Input
Assembly: WindowsBase (in windowsbase.dll)
XML Namespace:

public class TraversalRequest
public class TraversalRequest
public class TraversalRequest
You cannot use this managed class in XAML.

This class is used as an input parameter for the UIElement.MoveFocus method. The MoveFocus method has a WPF framework-level override that provides a more practical implementation (FrameworkElement.MoveFocus), as well as a parallel implementation on ContentElement and FrameworkContentElement. You typically will set properties on TraversalRequest in order to customize the focusing behavior when you request that the focus be moved to another element.

This class is also used as input parameters for the following methods:

The following example creates a TraversalRequest instance as input for a FrameworkElement.MoveFocus call.

// 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)

For the complete sample, see Manipulate Focus Programmatically Sample.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0