如何通过 Windows Phone 中的按钮单击事件处理枢轴滑动手势 [英] how to handle pivot swipe gesture through button click event in windows phone
本文介绍了如何通过 Windows Phone 中的按钮单击事件处理枢轴滑动手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何像windows phone Gallery Photo一样通过按钮点击事件滑动图像(从左到右或反之亦然,使用2个按钮<"和>").我使用pivot控件一张一张地滑动图像&列表框收集所有图像.它适用于滑动(触摸)手势.
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.
推荐答案
您可以通过设置 Pivot.SelectedIndex 轻松实现这一点
you can easily achieve this via setting the Pivot.SelectedIndex
喜欢
转发
if(Pivot.selectedIndex < Pivot.Items.Count)
Pivot.selectedIndex++;
else
Pivot.selectedIndex = 0;
后退
if(Pivot.selectedIndex > 0)
Pivot.selectedIndex--;
else
Pivot.selectedIndex = Pivot.Items.Count - 1;
这篇关于如何通过 Windows Phone 中的按钮单击事件处理枢轴滑动手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文