似乎 Blend 正在创建一个Template
而不是一个Style
.
这里值得一提的是一个JumpListStyle
可以使用的例子......
<phone:LongListSelector.JumpListStyle>
<Style TargetType="phone:LongListSelector">
<Setter Property="GridCellSize" Value="113,113"/>
<Setter Property="LayoutMode" Value="Grid" />
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Border Background="{Binding Converter={StaticResource BackgroundConverter}}"
Width="113"
Height="113"
Margin="6" >
<TextBlock
Text="{Binding Key}"
FontSize="42"
Padding="6"
Foreground="{Binding Converter={StaticResource ForegroundConverter}}"
VerticalAlignment="Center"/>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</phone:LongListSelector.JumpListStyle>
您还需要对ForegroundConverter
and的引用BackgroundConverter
。我将它放在 App.xaml 中,以便整个应用程序的样式保持一致。
<phone:JumpListItemBackgroundConverter x:Key="BackgroundConverter"
Disabled="{StaticResource MyThemeFGColor}" Enabled="{StaticResource MyThemeAccentColor}" />
<phone:JumpListItemForegroundConverter x:Key="ForegroundConverter"
Disabled="{StaticResource MyThemeFGColor}" Enabled="{StaticResource MyThemeBGColor}" />