欢迎访问移动开发之家(rcyd.net),关注移动开发教程。移动开发之家  移动开发问答|  每日更新
页面位置 : > > 内容正文

LongListSelector 控件 在 wp7 和wp8中的不同之处

来源: 开发者 投稿于  被查看 38191 次 评论:177

LongListSelector 控件 在 wp7 和wp8中的不同之处


1.首先能一眼看出来的,就是滑动时可以固定的,分组header了。

 这个原来我们都是放一个textblock在那个位置,滑动时根据可视区域所在的项目,然后赋给textblock值。
 现在省事多了。

2. 还有原来很费事才能实现的网格模式。现在通过layoutmode设置了。

 3. 原来的分组模板变成了JumpListStyle,由模板变成了样式,刚开始这块弄得有点晕,这让编辑变得有些不方便了。
为了方便记录下编辑好的样式,以后直接拷贝就好了。

<phone:PhoneApplicationPage.Resources> <phone: JumpListItemBackgroundConverter x:Key=/> <phone:JumpListItemForegroundConverter x:Key=/> <Style x:Key= TargetType=> <Setter Property= Value= /> <Setter Property= Value=/> <Setter Property=> <Setter.Value> <DataTemplate> <Border Background= Width= Height= Margin=> <TextBlock Text= Foreground= Font Family= FontSize= Padding= VerticalAlignment=/> </Border> </DataTemplate> </Setter.Value> </Setter> </Style> </phone:PhoneApplicationPage.Resources> View Code

这里有一点值得注意的是 JumpListItemBackgroundConverter and JumpListItemForegroundConverter
如果想设置可点击或不可点击的样式,可以用Disabled像下面这样

4.下面是官方给的一些属性,方法,和事件的变化。

从Windows Phone Toolkit 7.1的属性中

删除了

  • BufferSize
  • IsBouncy
  • IsScrolling
  • MaximumFlickVelocity
  • ShowListFooter/ShowListHeader

修改了

Windows Phone Toolkit 7.1

Windows Phone 8 ROM SDK

DisplayAllGroups

Display all groups in the list whether or not they have items. Default is true.

HideEmptyGroups

Hide all groups in the list without items. Default is false.
分组下没有项的话隐藏分组

GroupItemTemplate

JumpListStyle

IsFlatList

Gets or sets whether the list is flat instead of a group hierarchy. Default is true.

IsGroupingEnabled

Gets or sets whether the list is flat instead of a group hierarchy. Default is false. 分组展示需要开启此属性

新增部分

  • GridCellSize
  • LayoutMode LongListSelectorLayoutMode { List, Grid };
  • ManipulationState
 
    Manipulating, 
    Animating 
} 

 

从Windows Phone Toolkit 7.1的方法中

删除了

  • AnimateTo(object item)
  • CloseGroupView()
  • DisplayGroupView()
  • GetItemsInView()
  • GetItemsWithContainers(bool onlyItemsInView, bool getContainers)
  • ScrollToGroup(object group)

从Windows Phone Toolkit 7.1的事件中

删除了

  • StretchingBottom
  • StretchingCompleted
  • StretchingTop

修改了

Windows Phone Toolkit 7.1

Windows Phone 8 ROM SDK

ScrollingCompleted

ScrollingStarted

ManipulationStateChanged

(coupled with ManipulationState property)两者合二为一了

Link/Unlink

ItemRealized/ ItemUnrealized

With EventArgs including ItemKind

C#
  1.     
  2.     
  3.  
  4.     
  5.     

 

可以看到,其实变化挺大的。

wp 8 sdk中的LLS性能 明显要比之前提高了不少。

当然 panorama,和pivot的性能也有了很大的提高,尤其是panorama的数据加载。

 

 

 

相关频道:

用户评论