如何禁用Xbox One(C#,UWP)的指针模式

如何禁用Xbox One(C#,UWP)的指针模式,c#,xaml,uwp,xbox,xbox-one,C#,Xaml,Uwp,Xbox,Xbox One,我想知道如何在UWP应用程序上禁用指针模式。我已经设置了XYFocusKeyboardNavigation,当我将我的xbox one控制器插入PC时,一切都能正常工作。每当我调试控制台时,我都会有一个指针,而不是典型的xbox控件。我尝试通过添加以下命令来禁用它,但没有任何效果,请帮助: RequiresPointer="Never" //At Page Level this.RequiresPointer = RequiresPointer.Never; //On Load Requir

我想知道如何在UWP应用程序上禁用指针模式。我已经设置了XYFocusKeyboardNavigation,当我将我的xbox one控制器插入PC时,一切都能正常工作。每当我调试控制台时,我都会有一个指针,而不是典型的xbox控件。我尝试通过添加以下命令来禁用它,但没有任何效果,请帮助:

RequiresPointer="Never" //At Page Level

this.RequiresPointer = RequiresPointer.Never; //On Load

RequiresPointerMode = "WhenRequested" //In App.xaml

this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested; //tried on load but requirespointermode does not exist

Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested; //tried on load but got Error: System.NotSupportedException: 'Specified method is not supported.'
每当我调试控制台时,我都会有一个指针,而不是典型的xbox控件。我尝试通过添加以下命令来禁用它,但没有任何效果,请帮助:
this.requirepointermode=Windows.UI.Xaml.applicationrequirepointermode.when请求时//已尝试加载,但requirespointermode不存在

要关闭鼠标模式,请将以下内容添加到应用程序的构造函数中

App.xaml.cs

public App()
{
    this.InitializeComponent();
    this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
    this.Suspending += OnSuspending;
}
注意:

如果您正在编写C++/DirectX应用程序,则无需执行任何操作。鼠标模式仅适用于HTML和XAML应用程序


有关更多详细信息,您可以参考。

this.requirePointerMode、Suspending和OnSuspending的定义不存在。。。。我刚才试过这么做。有什么想法吗?
requirepointermode
Application
属性,您应该在
App.xaml.cs
文件中编写上述代码。否则它会抛出编译错误。谢谢你的帮助。。。。问题是,正如您所说,我试图将代码放在我的主窗体中,而不是App.xaml.cs中