オプションを更新するにはプールが必要なため、アプリケーションで ExtendedListView を使用しています。
nuget パッケージでインストールして ExtendedListview 0.0.5.5 をインストールしました: Install-Package ExtendedListview
リストビューに固定ヘッダーも必要です。
したがって、以下のコードで単純なリストビューで実行できます。
<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>
至急ご案内ください。
前もって感謝します。