I’m currently porting an application from iPhone to Windows Phone.
The behaviour of buttons is quite different between the two platforms.
In particular, on an iPhone one can press a button and release the button outside of the button area.
iOS has two events for handling this: Touch Up Inside and Touch Up Outside
On Windows Phone and Silverlight however, the behaviour is different, and unfortunately not the one I want.
You have the Click method that is called when the button is clicked , either when it’s actually clicked or when it’s released ; one way or the other (behaviour controlled via ClickMode value)
If you press the button and release it while your finger isn’t on the button precisely, no event will occur (though the state of the button will change as proven by its change of appearance)
Ultimately, what I would like to achieve is being able to trigger an event when the button is released, and that event should occur when the finger is released in either case just like it does on iPhone.
For example:
Press the button, move the finger outside the button, release the finger -> event triggered
The problem is detecting when the finger leaves the screen and not when it just leaves the button (which can easily be detected through the OsIsPressedChangeed)
Any ideas whoulc be greatly appreciated
Here is how I best managed to simulate a similar behaviour (key release event being generated even when the finger stop being on top of the button)
There is still a minor issue ; if you press a button, hold it, press another button, the Released event is generated for the first button, even though it is still pressed. Not sure how to get around this