对控件 UI 中的 StylusDown 做出反应?
我正在 WPF 中构建触摸屏应用程序,并且希望在用户用手指/触笔按下按钮时显示 UI 的更改。目前,一旦手指松开,您只会看到 UI 变化的闪烁,但在此之前什么也没有。
我一直在尝试将按钮模板中的触发器和/或事件触发器连接到诸如触笔按下和触地之类的东西,但无济于事。
我已经将一些控制台写入附加到按钮的事件连接起来,它们按以下顺序显示:
- StylusDown
- StylusButtonDown
- TouchDown
- StylusUp
- StylusButtonUp
- Click
当手指从屏幕上抬起时,所有这些都会同时触发。 (TouchUp 似乎根本没有触发)。
关于如何开始捕获按下模板中按钮的手指的任何想法,以便我可以让用户知道他们实际上正在按下按钮?
I'm building a touch screen application in WPF and I'm wanting to show a change in UI when the user presses a button with their finger/stylus. Currently you only get a flicker of UI change once the finger is released but nothing before that.
I've been trying to hook up triggers and/or eventtriggers in the button template to things like stylusdown and touchdown but to no avail.
I've hooked up some console writes on events attached to a button and they appear in the following order:
- StylusDown
- StylusButtonDown
- TouchDown
- StylusUp
- StylusButtonUp
- Click
All of which firing at the same time when the finger is lifted from the screen. (TouchUp doesn't seem to fire at all).
Any ideas on how I could begin to capture a finger pressing onto a button in the template so I can give the user some idea that they are actually pressing a button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更详细地写博客之后关于这个问题,我有一条评论建议使用 SurfaceWindow,然后使用 Surface Toolkit(目前处于 Beta 版)中的 SurfaceButtons,现在一切都按我的预期工作。
更新:该链接现已失效。这是 从 Wayback Machine 链接到该页面。
After blogging in more detail about this issue I had a comment recommending using a SurfaceWindow and then SurfaceButtons from the Surface Toolkit (currently in Beta) and now all is working as I would expect.
Update: The link is now dead. Here's the link to that page from Wayback Machine.