wp7手势识别

2016-08-20 10:32:46来源:http://sxchao.blog.51cto.com/907640/850007作者:sxchao2008人点击


这是wp7 应用开发silverlight的手势,非xna代码.



1. 引入dll



2.宋体;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin">引入命名空间 color:red;mso-font-kerning:0pt">


xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"


3.mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin">手势是依附控控件而存活的,在某个控件内部添加(这里是coverflowCalibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">第三方控件,),mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">添加了 Flickmso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">事件


<local:CollectionFlowx:Name="ImageList"ItemTemplate="{StaticResourceDataTemplate1}"ItemsPanel="{StaticResourceItemsPanelTemplate1}"><toolkit:GestureService.GestureListener><toolkit:GestureListenerFlick="GestureListener_Flick"/></toolkit:GestureService.GestureListener></local:CollectionFlow>


4.mso-font-kerning:0pt">


privatevoidGestureListener_Flick(objectsender,FlickGestureEventArgse){//监听器里面写相关处理代码,通过角度判断左右滑动.if(e.Angle>135&&e.Angle<225)//向左增加图片{}elseif(e.Angle>315||e.Angle<45)//向右增加图片{}}

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台