2

I am working on a Universal windows app. I added an EventTrigger to my listboxitems.

<Interactivity:Interaction.Behaviors>
  <Core:EventTriggerBehavior EventName="Tapped">
    <Core:InvokeCommandAction Command="{Binding GoToHotelsCommand}"/>
  </Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>

When i use EventName="Tapped", it does what it is suppose to do. But when i use EventName="PointerPressed", nothing is triggered. The 'Tapped' trigger does solve my problem, but i was curious why it won't work with pointer pressed. isn't the Pointer pressed eventtrigger's purpose to be triggered when the pointer is pressed? Or am i missing something?

Kasper Due
  • 699
  • 7
  • 19
  • Is pointerpressed not working when using a pointer device, like a mouse? – Chris W. Apr 11 '16 at 19:46
  • yes, it is not working with a mouse – Kasper Due Apr 11 '16 at 20:11
  • 1
    Hadn't ran into the issue yet but it appears you're not the only one with the issue judging by a quick google search. Wish I had an answer for ya, but there are some pretty sharp MSFT'ers that frequent here I could think of that might educate both of us. – Chris W. Apr 11 '16 at 20:15

1 Answers1

5

Actually Tapped fires on/after PointerReleased event...

Answer is here:

SomeButton.AddHandler(PointerPressedEvent, new PointerEventHandler(SomeButton_PointerPressed), true); 
Community
  • 1
  • 1
Yuriy Pelekh
  • 168
  • 7