David Jacob
David Jacob

Reputation: 213

WP7 - XNA to Silverlight navigation back Gesture issue

I am having total reverse issue. I have main screen set as Silverlight and from that, i go the XNA code which actually plays my game.

Now the issue is that first time when i navigate from SL to XNA, it works fine since my gestures are not set. Here I set my gestures. Now i navigate back to first screen (silverlight). From there i click Play button again to open my xna code. Here it gives me TouchPanel.IsGestureAvailable == true by default which is causing issue to my game play.

I need to make sure that when user navigate from XNA to Silverlight, all gestures should be disabled so when user navigate again from SL to XNA... it works fine.

Can anyone please help me since i have been stuck from 2 days and not getting any solutions.

Thanks in advance. Jacob

Upvotes: 0

Views: 290

Answers (2)

user1589671
user1589671

Reputation: 51

When navigating back from XNA find your last function working in XNA and in the end add

TouchPanel.EnabledGestures = GestureType.None;

This will disable TouchPanel in XNA recieving gestures. Next time you navigate to XNA, enable gestures you need.

Upvotes: 1

Skiba
Skiba

Reputation: 480

I assume your creating SilverlightXNA project.

Have you tried setting this in overriden method onNavigetedFrom in your gamePage?

Upvotes: 0

Related Questions