WP7 Toggle switch in a Pivot control?

≯℡__Kan透↙ 提交于 2019-12-01 06:15:09

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!