如何在LongListSelector Window Phone 8和Blend 2012中编辑跳转样式

时间:2014-02-18 01:07:23

标签: visual-studio-2012 windows-phone-8 longlistselector blend-2012

我正在尝试使用Blend 2012来编辑您可以使用现在内置的longlistselector设置的跳转列表区域。

我在使用Windows Phone Toolkit时遇到了问题,但现在我遇到了很大麻烦。

enter image description here

我尝试制作模板的副本,然后我看到了

enter image description here

我现在不知道接下来该做什么。我想添加一个文本块并设置它的样式。这当然是跳转菜单风格。

1 个答案:

答案 0 :(得分:0)

似乎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>

您还需要引用ForegroundConverterBackgroundConverter。我把它放在App.xaml中,这样整个应用程序的样式都是一致的。

<phone:JumpListItemBackgroundConverter x:Key="BackgroundConverter" 
            Disabled="{StaticResource MyThemeFGColor}" Enabled="{StaticResource MyThemeAccentColor}" />
<phone:JumpListItemForegroundConverter x:Key="ForegroundConverter"
            Disabled="{StaticResource MyThemeFGColor}" Enabled="{StaticResource MyThemeBGColor}" />
相关问题