一直想写点什么,直到今天才真正开始写,唯一的原因就是太懒了,太懒了。。。想必大家都很熟悉了各种Android客户端(如淘宝)首页的联动图片广告,可以自动滚动,手动滑动,当然是循环的。不过最早在wp上看到的是lovewallpaper。写在wp8.1的filpview即将到来之际。让我们转到代码。如果有4张图片,最后一张要加到最前面,然后把***图加到第一页,这样到了最前面或者第一页的时候,直接修改TranslateX就可以达到效果循环。颜色转换器publicclassSlideViewMarkColorConverter:IValueConverter{privateSolidColorBrushbrush=newSolidColorBrush();publicobjectConvert(objectvalue,TypetargetType,objectparameter,System.Globalization.CultureInfoculture){if((int)value==(int)parameter){brush.Opacity=1;brush.Color=Colors.White;}else{brush.Opacity=0.4;brush.Color=Colors.Black;}returnbrush;}publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,System.Globalization.CultureInfoculture){thrownewNotImplementedException();}}MarkSource绑定实体,其中MarkIndex修改为实体的sn,如果实体数大于1,则在ItemsSource前插入***,然后在ItemsSource后添加******如果控件放在pivot中,则无法滑动。在页面后置代码loadevent里面加上slideview.UseOptimizedManipulationRouting=false;slideview.AddHandler(PivotItem.ManipulationStartedEvent,newEventHandler(myPivotItem_ManipulationStarted),true);slideview.AddHandler(PivotItem.ManipulationDeltaEvent,newEventHandler(myPivotItem_ManipulationDelta),true);slideview.AddHandler(PivotItem.ManipulationCompletedEvent,newEventHandler(myPivotItem_ManipulationCompleted),true);myPivotItem_ManipulationStartedmyPivotItem_ManipulationDeltamyPivotItem_ManipulationCompleted事件里面判断if(e.OriginalSource.GetType()==typeof(Image)){e.Handled=true;}