I am developing a WPF kiosk like client that will be deployed on an HP TouchSmart Windows 7 machine with multi-touch enabled. My problem is that with Windows 7 multi-touch, the application does not recognize a finger ‘tap’ as a button press event, and therefore the button press Trigger to change color is never fired.
The Windows 7 animation for the touch usually displays, and the button click event fires fine. It is only the XAML define style for the ‘IsPressed’ event that does not function as intended on a finger tap. It does eventually work if enough pressure is applied with a finger and/or you roll or press like you would do for a fingerprint. Is there a workaround for to make a ‘tap’ fire a press/click event?
<Trigger Property="AreAnyTouchesOver" Value="true">
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource PressedOff}" />
</Trigger.ExitActions>
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource PressedOn}" />
</Trigger.EnterActions>
</Trigger>
<Trigger Property="AreAnyTouchesDirectlyOver" Value="true">
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource PressedOff}" />
</Trigger.ExitActions>
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource PressedOn}" />
</Trigger.EnterActions>
</Trigger>
I am not clear on what you want t do.
Some explanation on your issue:
In touch IsPressed is only triggered when your contact is held down over the element and the movement threshold is passed to create a “press” (That is why you see it if you press the finger down and slide it slightly)
As soon as the contact comes up IsPressed = false.
When you “tap” a button you are in essence doing a mouse click. This is why events fires as expected.
So what exactly are you trying to do? You want to fire an storyboard animation when a button is “held down” (“IsPressed”) or when a button is clicked (tapped).
These are two different situations, also note that often times desktop metaphors do not translate well to the touch environment. You may want to rethink how you are giving visual feedback to the user.
I think the easiest answer for what you want to is Trigger on “TouchDown” if I understand your questions correctly.
UPDATE:
This should work for a TouchDown trigger
NOTE: I don’t have a touch screen in front of me so there could be errors but it looks correct.