- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我创建了一个 WPF 应用程序。它在台式机上工作得很好,但当应用程序在触摸屏上运行时它崩溃了。我关闭了触摸屏进程,应用程序运行良好。我想知道有没有人找到比禁用触摸屏进程“更好”的修复方法,因为这在 Microsoft Surface 或 Windows 平板电脑上不起作用。
我目前使用的是 .Net 4.5
最佳答案
我在使用 WPF AutomationPeer
时也遇到过很多问题。
您可以通过强制 WPF UI 元素使用自定义 AutomationPeer 来解决您的问题,该自定义 AutomationPeer 通过不返回子控件的 AutomationPeers 而与默认行为不同。这可能会阻止任何 UI 自动化的工作,但希望在你的情况下,就像在我的情况下,你没有使用 UI 自动化..
创建一个继承自 FrameworkElementAutomationPeer
并覆盖 GetChildrenCore
方法的自定义自动化对等类,以返回一个空列表而不是子控件自动化对等。当某些东西试图遍历 AutomationPeers 树时,这应该会阻止问题的发生。
同时覆盖 GetAutomationControlTypeCore
以指定您将在其上使用自动化对等的控件类型。在此示例中,我将 AutomationControlType
作为构造函数参数传递。如果您将自定义自动化对等应用到 Windows,它应该可以解决您的问题,因为我认为根元素用于返回所有子元素。
public class MockAutomationPeer : FrameworkElementAutomationPeer
{
AutomationControlType _controlType;
public MockAutomationPeer(FrameworkElement owner, AutomationControlType controlType)
: base(owner)
{
_controlType = controlType;
}
protected override string GetNameCore()
{
return "MockAutomationPeer";
}
protected override AutomationControlType GetAutomationControlTypeCore()
{
return _controlType;
}
protected override List<AutomationPeer> GetChildrenCore()
{
return new List<AutomationPeer>();
}
}
要使用自定义自动化对等点,请覆盖 UI 元素中的 OnCreateAutomationPeer
方法,例如窗口:
protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
{
return new MockAutomationPeer(this, AutomationControlType.Window);
}
关于c# - 触摸屏设备上的 WPF AutomationPeer 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35727592/
我这里有这样的 slider :https://jsfiddle.net/args91L4/我如何让它在触摸屏上工作,更准确地说,在 vanilla js 或纯 jquery 上没有第三方插件的方式是
我正在使用 HP 触摸屏台式计算机开发一个简单的网站。我想防止用户同时用八个手指“捣碎”屏幕点击。 jQuery 有没有办法一次只允许注册一个触摸事件?这样,当第一个手指点击屏幕时,即注册了该手指,并
我有一个 Web 应用程序,需要有在自助服务终端样式、仅触摸屏环境中使用的选项。我想知道是否有任何我们可以使用的基于浏览器的好键盘。可能是基于 javascript 或 jquery 的东西。基本上,
我有一个 div,它在桌面浏览器上滚动得很好,但在带有触摸屏的移动设备上,滚动不起作用。 这是一个stripped down jsFiddle带有一些实际代码。滚动在您的移动浏览器中运行良好,但请相信
我有一台装有 Windows 7 的触摸屏电脑,我想禁用多点触控手势: 但即使我禁用它并应用更改,当我重新打开窗口时,该选项也会再次启用... 知道在哪里可以永久禁用它吗? (也许在注册表中...)
在移动设备(触摸屏)上缩放后,Highmap 数据点单击事件中断有什么建议吗? 最佳答案 tooltip.pointFormatter 与 useHTML 结合使用仍然期望一个字符串作为返回值,因此应
我正在用Java(使用Swing)为自动机开发一个基于触摸屏的应用程序,例如this 。由于操作系统会处理所有触摸事件,因此我只需开发一个桌面应用程序并在触摸设备上使用它即可。 如果有人可以帮助我,我
我会尽可能清楚地描述我的问题。我正在尝试让触摸屏设备与 Android 一起工作。该设备是一个 USB 设备,我让它在各种操作系统(Windows、Mac OS X、Ubuntu)中正常工作。在 An
我们有一个在 Win 7 上运行的 WPF 应用程序。在 Win 7 中启用触摸手势,当滚动 ListView 时,应用程序在到达列表末尾时在屏幕上“耸耸肩”。 这也可以在 Internet Expl
我需要在我的 Android 设备上禁用和启用触摸屏。我试过了 adb shell su rm -rf /dev/input/event2 和 adb shell su rm -rf /dev/inp
我有一台运行 Windows 10 的 PiPo x9(触摸屏)。Google Chrome 已加载,可以正确查看网页。通过 CefBrowser 加载的同一页面对鼠标事件做出奇怪的响应。我使用的是
我有一台运行 Windows 10 的 PiPo x9(触摸屏)。Google Chrome 已加载,可以正确查看网页。通过 CefBrowser 加载的同一页面对鼠标事件做出奇怪的响应。我使用的是
希望有人能帮我解决这个问题,为此我苦苦挣扎了一会儿。我需要为触摸设备上的最终用户提供“单击”下拉菜单以显示子菜单项的能力。就桌面体验而言,这显然是一种常见的 UX 构造,但对于移动或触摸设备而言,它并
我在这个网站上有一个菜单,它在标准 Windows 8.1 PC 上的 chrome 上运行正常,但在带有触摸屏的 Windows 8.1 笔记本电脑上的 chrome 上查看时出现奇怪的问题。 子菜
我正在用 Java 开发一个 Swing 应用程序。该程序将在专用的 Windows 7 触摸屏机器上运行,据我所知,在正常操作下,该程序应该是唯一在这些机器上运行的东西。 我注意到 Windows
目前我正在 STM32f4 板上开发 USB 触摸屏 HID 描述符(自定义 HID 描述符)。为此,我为单个联系人标识符(单手指触摸)实现了一个 HID 描述符,它对我有用。但是,我的要求是多点触摸
大家早上好。 我买了一个集成了电阻式触摸屏的液晶嵌入式显示器。TS 可通过 USB 连接。 我已将其连接到运行 Android 4.0.3 的设备,并且触摸被正确识别为外部 HID。问题:点击(按下)
我想知道是否可以在 microsoft Surface 触摸屏(例如 Samsung SUR40 不是 Surface 平板电脑)又名 pixelsense ? 我在互联网上搜索了一整天,但找不到任何
最近我正在开发基于谷歌地图的网站。它适用于大多数设备,但是当我在 MS Surface 触摸屏上安装 Chrome 浏览器后,我无法用手指捏合和缩放谷歌地图。但我可以使用 Chrome 浏览器在map
我是一名优秀的程序员,十分优秀!