how to handle pivot swipe gesture through button click event in windows phone [closed]

此生再无相见时 提交于 2019-12-25 19:32:27

问题


How to swipe images through button click event just like windows phone Gallery Photo(left to right or vice verse,use 2 button "<" and ">").I have use pivot control to swipe images one by one & list box to collect all images.It is working fine for swipe(touch) gesture.


回答1:


you can easily achieve this via setting the Pivot.SelectedIndex

like

for forward

if(Pivot.selectedIndex < Pivot.Items.Count)
    Pivot.selectedIndex++;
else
    Pivot.selectedIndex = 0;

for backward

if(Pivot.selectedIndex > 0)
    Pivot.selectedIndex--;
else
    Pivot.selectedIndex = Pivot.Items.Count - 1;


来源:https://stackoverflow.com/questions/20297302/how-to-handle-pivot-swipe-gesture-through-button-click-event-in-windows-phone

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