views:

145

answers:

2

Hello! I'm writing a Windows phone 7 Silverlight Application. and i have to set Visibility of my Stackpanel to Collapsed when mouse leaves this control. But this event occurs even if i simply click on my control without mouse movings. Lost focus event doesn't work too. How to achieve my goal? Thx in advance!

A: 

If you are looking for a "mouse hover" effect, then you might need to rethink how the user interacts with your application as MouseMove events are fired only while the user has a finger down on the screen.

Andréas Saudemont
+3  A: 

LostFocus is only triggered when a user taps on another control, as mentioned there are no hover events as the mouse metaphor does not work here as this is a touch-based environment - the best way to deal with control behaviour is to imagine using your finger to interact with the control - this may allow to design a behaviour which works the way you want, then see how this would work practically, a touch on the screen starts a click so there is no mousemove without a mousedown too.

RoguePlanetoid