我有一个listView和组描述符来查看我的数据(参见capture1)。
我想在列表视图中的每个“组”上重复网格的标题行,如下面的capture2:
我的xaml
<Grid Grid.Row="1" Margin="0,0,0,-80">
<ListView ItemsSource="{Binding ParcVoisinsCollectionView}" >
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView >
<!--<GridView.ColumnHeaderContainerStyle>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<TextBlock Text="" Padding="5">
<TextBlock.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#77797B" />
</LinearGradientBrush>
</TextBlock.Background>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GridView.ColumnHeaderContainerStyle>-->
<GridViewColumn Header="NomParc" Width="50" DisplayMemberBinding="{Binding NomParc}" />
<GridViewColumn Header="NomEolienne" Width="120" DisplayMemberBinding="{Binding NomEolienne}" />
<GridViewColumn Header="TypeEolienne" Width="120" DisplayMemberBinding="{Binding TypeEolienne}" />
<GridViewColumn Header="Puissance" Width="50" DisplayMemberBinding="{Binding Puissance}" />
<GridViewColumn Header="Diametre" Width="120" DisplayMemberBinding="{Binding Diametre}" />
<GridViewColumn Header="Hauteur" Width="120" DisplayMemberBinding="{Binding Hauteur}" />
<GridViewColumn Header="X" Width="120" DisplayMemberBinding="{Binding PositionX}" />
<GridViewColumn Header="Y" Width="120" DisplayMemberBinding="{Binding PositionY}" />
</GridView>
</ListView.View>
<ListView.GroupStyle >
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Expander IsExpanded="True">
<Expander.Header>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Gray" FontSize="22" VerticalAlignment="Bottom" />
<TextBlock Text="{Binding ItemCount}"
FontSize="22" Foreground="Green" FontWeight="Bold" FontStyle="Italic" Margin="10,0,0,0" VerticalAlignment="Bottom" />
<TextBlock Text=" éoliennes(s)" FontSize="22" Foreground="Silver" FontStyle="Italic" VerticalAlignment="Bottom" />
</StackPanel>
</Expander.Header>
<ItemsPresenter>
</ItemsPresenter>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
</Grid>
</Grid>
我该怎么做?