I’ve got an issue with the Pivot Control on Windows Phone 7. In the application I’m developing, in addition to being able to use the standard swipe left and right to change pivot page the pivot control also auto advances when buttons are pressed by setting the SelectedIndex.
During the transition if the screen is tapped a button press is registered. Until the animation has settled this button press is for the wrong button. (I.e. if the SelectedItem is increasing a tap on the right side of the screen will result in a button on the left side being selected)
The application being implemented is a quiz application. A rewrite to replace the pivot control isn’t really feasible at this stage as the app is near complete apart from this one issue, and the Pivot provides all the rest of the functionality required.
So, is there any way to stop input being passed while the animation is in progress?
I’ve tried setting IsEnabled on the Pivot, but this causes the animation to lose all fluidity – simply flashing to the next item rather than scrolling. Presumably because both these tasks will be running on the UI thread.
Has anyone got any other suggestions for solutions?
Change the
IsHitTestVisibleproperty of the pivot during the changing of the PivotItem to prevent such taps.Set it to
falsewhen the pivot isUnloadingPivotItemand then enable it on theLoadedPivotitemevent.