XYFocusNavigationStrategy XYFocusNavigationStrategy XYFocusNavigationStrategy XYFocusNavigationStrategy Enum

Definition

Specifies the disambiguation strategy used for navigating between multiple candidate targets using XYFocusDownNavigationStrategy, XYFocusLeftNavigationStrategy, XYFocusRightNavigationStrategy, and XYFocusUpNavigationStrategy.

Note

Other factors, such as the previously focused element or proximity to the axis of the navigation direction, can influence the navigation end result.

public : enum class XYFocusNavigationStrategy
enum class winrt::Windows::UI::Xaml::Input::XYFocusNavigationStrategy : int32_t
public enum XYFocusNavigationStrategy
Public Enum XYFocusNavigationStrategy
Attributes

Windows 10 requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Fields

Auto Auto Auto Auto 0

Indicates that navigation strategy is inherited from the element's ancestors. If all ancestors have a value of Auto, the fallback strategy is Projection.

NavigationDirectionDistance NavigationDirectionDistance NavigationDirectionDistance NavigationDirectionDistance 2

Indicates that focus moves to the element closest to the axis of the navigation direction.

The edge of the bounding rect corresponding to the navigation direction is extended and projected to identify candidate targets. The first element encountered is identified as the target. In the case of multiple candidates, the closest element is identified as the target. If there are still multiple candidates, the topmost/leftmost element is identified as the candidate.

Focus navigation - distance

Focus moves from A to C and then from C to B on down navigation

Projection Projection Projection Projection 1

Indicates that focus moves to the first element encountered when projecting the edge of the currently focused element in the direction of navigation.

Focus navigation - projection

Focus moves from A to D on down navigation based on projection of the bottom edge of A

RectilinearDistance RectilinearDistance RectilinearDistance RectilinearDistance 3

Indicates that focus moves to the closest element based on the shortest 2D distance (Manhattan metric).

This distance is calculated by adding the primary distance and the secondary distance of each potential candidate. In the case of a tie:

  • The first element to the left is selected if the navigation direction is up or down
  • The first element to the top is selected if the navigation direction is left or right

Here we show how focus moves from A to B based on rectilinear distance.

  • Distance (A, B, Down) = 10 + 0 = 10
  • Distance (A, C, Down) = 0 + 30 = 30
  • Distance (A, D, Down) 30 + 0 = 30
Focus navigation - rectilinear distance

Focus moves from A to B based on rectilinear distance

Remarks

XY navigation is used to navigate a user interface (UI) with a gamepad, remote control, or keyboard directional arrows. For more info, see Gamepad and remote control interactions

See also

  • # Reference - T:Windows.UI.Xaml.Input.XYFocusNavigationStrategyOverride ### Conceptual - [Programmatic focus navigation](https://docs.microsoft.com/windows/uwp/input-and-devices/focus-navigation-programmatic) - [Desiging for Xbox - XY focus navigation and interaction](https://msdn.microsoft.com/windows/uwp/input-and-devices/designing-for-tv#xy-focus-navigation-and-interaction)