开发者

WP7 Toggle switch in a Pivot control?

Is there any way to control the threshold of the flick action to on/off a toggle switch so that it do开发者_如何学JAVAesn't mess with the pivot control's navigation?


Sorry, but I'm going to avoid you're question (I can't answer it anyway) and suggest you use a different approach.
You could (I assume) use a checkbox to just as easily provide the option to the person using the application. Afterall a toggle switch has the same functionality as a checkbox (specify/choose between two states) it just implements the interaction differently.

The toggle switch has not been designed/built (AFAIK) to support being used on top of something which also supports the same gesture.
As a general rule of usability, having controls on top of each other (or even next to each other) which support the same gesture is likely to cause problems for the user. Even if the problems are through accidentaly triggering the wrong gesture or expectations about how their gesture will be interpretted.

In summary: this is a really tricky problem to solve; I don't think you can with the controls as they are; and the problem goes away entirely if you use a different control for toggling anyway.


I've had the same problem with my codermate, we've been digging this for many hours and we finally reached the top of the hill and we came up with a solution. This solution works for the bing map control:

on mouse enter: myMapControl.CaptureMouse(); on mouse leave: myMapControl.ReleaseMouseCapture();

And there you go, when you'll navigate inside the map the pivot won't do transition ;) If you don't get the point, just poke me and I'm going to explain with real code (I'm quite busy right now).

Cheers


This solution posted recently seems to be working out for people for dealing with gesture conflicts on pano / pivot. You might like to check it out.

Preventing the Pivot or Panorama controls from scrolling


Set the IsHitTestVisible = false in your root pivot control


The solution to this is simple, and comes from my experience with Android and iPhone application development.

simply make sure you only tap into the OnMouseLeave event - not the OnChecked or the OnMouseClick as these will accidentally fire just by touching the toggle.

You want make sure that they were touching it when they let go of the screen, and this (unless you put the toggle on the edge of the screen will almost never be the case

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜