KeyboardNavigation Class
Provides logical and directional navigation between focusable objects.
Assembly: PresentationFramework (in PresentationFramework.dll)
The KeyboardNavigation type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AcceptsReturn | Gets or sets a value indicating whether the Return character is accepted by a control. |
![]() | ControlTabNavigation | Gets or sets the logical control tab navigation behavior for the children of the element that this property is set on. |
![]() | DirectionalNavigation | Gets or sets the directional navigation behavior for the children of the element that this property is set on. |
![]() | IsTabStop | Gets or sets a value indicating whether the element that this property is set on is a tab stop. |
![]() | TabIndex | Gets or sets the tab index for the element that this property is set on. |
![]() | TabNavigation | Gets or sets the logical tab navigation behavior for the children of the element that this property is set on. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | GetAcceptsReturn | Gets the value of the AcceptsReturn attached property for the specified element. |
![]() ![]() | GetControlTabNavigation | Gets the value of the ControlTabNavigation attached property for the specified element. |
![]() ![]() | GetDirectionalNavigation | Gets the value of the DirectionalNavigation attached property for the specified element. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetIsTabStop | Gets the value of the IsTabStop attached property for the specified element. |
![]() ![]() | GetTabIndex | Gets the value of the TabIndex attached property for the specified element. |
![]() ![]() | GetTabNavigation | Gets the value of the TabNavigation attached property for the specified element. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | SetAcceptsReturn | Sets the value of the AcceptsReturn attached property for the specified element. |
![]() ![]() | SetControlTabNavigation | Sets the value of the ControlTabNavigation attached property for the specified element. |
![]() ![]() | SetDirectionalNavigation | Sets the value of the DirectionalNavigation attached property for the specified element. |
![]() ![]() | SetIsTabStop | Sets the value of the IsTabStop attached property for the specified element. |
![]() ![]() | SetTabIndex | Set the value of the TabIndex attached property for the specified element. |
![]() ![]() | SetTabNavigation | Sets the value of the TabNavigation attached property for the specified element. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | AcceptsReturnProperty | Identifies the AcceptsReturn attached property. |
![]() ![]() | ControlTabNavigationProperty | Identifies the ControlTabNavigation attached property. |
![]() ![]() | DirectionalNavigationProperty | Identifies the DirectionalNavigation attached property. |
![]() ![]() | IsTabStopProperty | Identifies the IsTabStop attached property. |
![]() ![]() | TabIndexProperty | Identifies the TabIndex attached property. |
![]() ![]() | TabNavigationProperty | Identifies the TabNavigation attached property. |
The KeyboardNavigation class is responsible for implementing default keyboard focus navigation when one of the navigation keys is pressed. The navigation keys are: Tab, Shift+Tab, Ctrl+Tab, Ctrl+Shift+Tab, UpArrow, DownArrow, LeftArrow, and RightArrow keys.
An example of logical navigation is using the tab key to move focus.
An example of directional navigation is using the arrow keys to move focus.
The following example creates a Menu with a number of MenuItem objects. The TabNavigation attached property is set to Cycle on the Menu. This means that when focus is changed using the tab key within the Menu, focus will move from each element and when the last element is reached focus will return to the first element.
<Menu KeyboardNavigation.TabNavigation="Cycle"> <MenuItem Header="Menu Item 1" /> <MenuItem Header="Menu Item 2" /> <MenuItem Header="Menu Item 3" /> <MenuItem Header="Menu Item 4" /> </Menu>
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
