了解 Windows 10 何时处于平板电脑模式 - Windows 10 / Windows 10 Mobile

2024-04-30

我致力于开发适用于 Windows 10 和 Windows 10 Mobile 的通用应用程序。 有谁知道如何检查 Windows 10 是否在平板电脑模式下运行?

我在这里找到了这个问题,但这是针对 Windows 窗体的:如何在 Windows 窗体应用程序中检测 Window 10 何时进入平板电脑模式? https://stackoverflow.com/questions/31153664/how-can-i-detect-when-window-10-enters-tablet-mode-in-a-windows-forms-applicatio

Thanks


You 查询用户交互模式 https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.viewmanagement.uiviewsettings.userinteractionmode.aspx- 这是该链接的示例代码

switch(UIViewSettings.GetForCurrentView().UserInteractionMode)
{
  case UserInteractionMode.Mouse:
    VisualStateManager.GoToState(this, "MouseLayout", true);
    break;

  case UserInteractionMode.Touch:
  default:
    VisualStateManager.GoToState(this, "TouchLayout", true);
    break;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

了解 Windows 10 何时处于平板电脑模式 - Windows 10 / Windows 10 Mobile 的相关文章

随机推荐