Windows 8.1手机应用程序ExtendedListView.GroupStyle无法正常工作

时间:2015-08-05 12:06:17

标签: windows-phone-8.1 longlistselector groupstyle

我在我的应用程序中使用ExtendedListView,因为我需要池来刷新选项。

我已经使用nuget package安装了ExtendedListview 0.0.5.5:Install-Package ExtendedListview

现在我还想在listview中添加一个粘性标题。

所以我可以通过下面的代码在Simple List视图中完成它。

<ListView IsHoldingEnabled="True"
    ItemsSource="{Binding Source={StaticResource AddressGroups}}"
    ItemTemplate="{StaticResource AddrBookItemTemplate}"
    ContinuumNavigationTransitionInfo.ExitElementContainer="True">
    <ListView.GroupStyle>
        <GroupStyle HidesIfEmpty="True" HeaderTemplate="{StaticResource AddrBookGroupHeaderTemplate}"/>
    </ListView.GroupStyle>
</ListView>

但同样的事情不适用于ExtendedListView。

<ctrl:ExtendedListView IsHoldingEnabled="True"
        ItemsSource="{Binding Source={StaticResource AddressGroups}}"
        ItemTemplate="{StaticResource AddrBookItemTemplate}"
        ContinuumNavigationTransitionInfo.ExitElementContainer="True"  >
    <ctrl:ExtendedListView.GroupStyle>
        <GroupStyle HeaderTemplate="{StaticResource AddrBookGroupHeaderTemplate}" />
    </ctrl:ExtendedListView.GroupStyle>
</ctrl:ExtendedListView>

我在两个代码中使用了相同的HeaderTemplate,如下所示:

<DataTemplate x:Key="AddrBookGroupHeaderTemplate">
    <Border Background="Transparent" Padding="5">
        <Border Background="Red" BorderBrush="Red" BorderThickness="2" Width="80" 
                Height="62" Margin="0,0,18,0" HorizontalAlignment="Left">
            <TextBlock Text="{Binding Key}" Foreground="White" FontSize="48" Padding="6" 
                        HorizontalAlignment="Left" VerticalAlignment="Center"/>
        </Border>
    </Border>
</DataTemplate>

请尽快指导我。

提前致谢。

0 个答案:

没有答案