1

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?

kizu
  • 42,604
  • 4
  • 68
  • 95
Ben Lowe
  • 11
  • 3

1 Answers1

0

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.

Mahdi Ghiasi
  • 14,873
  • 19
  • 71
  • 119
Ben Lowe
  • 11
  • 3