如何知道Windows设备上存在后退按钮-硬件/软件-Windows 10桌面/移动应用程序-C#
我需要检查运行我的应用程序的特定Windows设备是否在设备的硬件或软件(平板电脑模式下的Windows 10)中具有“后退”按钮 有人能帮我吗?如何知道Windows设备上存在后退按钮-硬件/软件-Windows 10桌面/移动应用程序-C#,c#,windows-10,back,uwp,windows-10-mobile,C#,Windows 10,Back,Uwp,Windows 10 Mobile,我需要检查运行我的应用程序的特定Windows设备是否在设备的硬件或软件(平板电脑模式下的Windows 10)中具有“后退”按钮 有人能帮我吗? 感谢提供“硬件后退”按钮,您可以使用ApiInformation.IsTypePresent方法轻松检查它 public MainPage() { this.InitializeComponent(); bool isHardwareButtonsAPIPresent = Wi
感谢提供“硬件后退”按钮,您可以使用ApiInformation.IsTypePresent方法轻松检查它
public MainPage()
{
this.InitializeComponent();
bool isHardwareButtonsAPIPresent =
Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons");
if(isHardwareButtonsAPIPresent)
{
// add Windows Mobile extenstions for UWP
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
}
}
private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
// hareware button pressed
}
按后退按钮应始终出现:手机、平板电脑、Surface Hub
对于桌面/笔记本电脑软件,可以启用/禁用应用程序标题栏中的按钮。您可以通过获取属性来检查它是否可见:
您想知道是否提供了一个硬件/系统,还是想强制系统为您绘制一个?你最终想做什么?对。谢谢。但对于虚拟后退按钮,请键入在平板电脑模式下运行Windows 10,有什么建议吗?谢谢
bool isSoftwareButton = SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility == AppViewBackButtonVisibility.Visible;