Control.XYFocusRight 属性

定义

获取或设置当用户向右按方向键 (方向键时获取焦点的对象) 。

public:
 property DependencyObject ^ XYFocusRight { DependencyObject ^ get(); void set(DependencyObject ^ value); };
DependencyObject XYFocusRight();

void XYFocusRight(DependencyObject value);
public DependencyObject XYFocusRight { get; set; }
var dependencyObject = control.xYFocusRight;
control.xYFocusRight = dependencyObject;
Public Property XYFocusRight As DependencyObject
<control XYFocusRight="{x:Bind dependencyObjectValue}"/>

属性值

当用户向右按方向键 (方向键时获得焦点的对象) 。

Windows 要求

设备系列
Windows 10 Anniversary Edition (在 10.0.14393.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v3.0 中引入)

注解

XYFocusRight 仅在 Xbox 设备系列上受支持,并且仅当使用游戏板或遥控器时。 否则,将忽略 属性。

有关此属性的详细信息,请参阅 Xbox 和电视设计文章的 XY 焦点导航和交互部分。

版本兼容性

XYFocusRight 属性在 Windows 10 版本 1607 之前不可用。 如果你的应用在 Microsoft Visual Studio 中的“最低平台版本”设置小于本页稍后的“要求”块中显示的“引入版本”,则必须设计和测试应用以考虑到这一点。 有关详细信息,请参阅 版本自适应代码

若要避免应用在以前版本的 Windows 10 上运行时出现异常,请勿在 XAML 中设置此属性,或者在不执行运行时检查的情况下使用它。 此示例演示如何使用 ApiInformation 类在设置此属性之前检查此属性是否存在。

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "XYFocusRight"))
{
    button1.XYFocusRight = button2;
}

适用于