






















参考文献 Windows Phone 8 XAML LongListSelector

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


1 <phone:PhoneApplicationPage.Resources> 2 <phone: JumpListItemBackgroundConverter x:Key="BackgroundConverter"/> 3 <phone:JumpListItemForegroundConverter x:Key="ForegroundConverter"/> 4 5 <Style x:Key="JumpListStyle" TargetType="phone:LongListSelector"> 6 <Setter Property="LayoutMode" Value="List" /> 7 <Setter Property="Margin" Value="12,12,0,0"/> 8 <Setter Property="ItemTemplate"> 9 <Setter.Value> 10 <DataTemplate> 11 <Border Background="{Binding Converter={StaticResource BackgroundConverter}}" 12 Width="470" 13 Height="70" 14 Margin="6"> 15 <TextBlock Text="{Binding Key}" 16 Foreground="{Binding Converter= {StaticResource ForegroundConverter}}" 17 Font Family="{StaticResource PhoneFontFamilySemiBold}" 18 FontSize="28" 19 Padding="2" 20 VerticalAlignment="Bottom"/> 21 </Border> 22 </DataTemplate> 23 </Setter.Value> 24 </Setter> 25 </Style> 26 </phone:PhoneApplicationPage.Resources>
View Code
这里有一点值得注意的是 JumpListItemBackgroundConverter and JumpListItemForegroundConverter
如果想设置可点击或不可点击的样式,可以用Disabled="Bisque" Enabled="Aqua"像下面这样
<phone:JumpListItemBackgroundConverter Disabled="Bisque" Enabled="Aqua" x:Key="BackgroundConverter"/><phone:JumpListItemForegroundConverter Disabled="Azure" Enabled="BlueViolet" x:Key="ForegroundConverter"/>
|
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. 分组展示需要开启此属性 |
public enum ManipulationState { Idle, // nothing is manipulating or animating Manipulating, // Gesture is being recognized, finger is down and any delta is received, drag/pan or flick Animating //No Gesture is currently happening, but there is some animation happening, like scroll animation or compression animation }
|
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#
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。