1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| <ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Margin" Value="0,0,0,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True" BorderBrush="#FFA4B97F" BorderThickness="0,0,0,1">
<Expander.Resources>
<converter:SumPortionsConverter x:Key="converterSumPortions"/>
</Expander.Resources>
<Expander.Header>
<DockPanel>
<TextBlock FontWeight="Bold" Width="270" Margin="5,0,0,0">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} : {1}">
<Binding Path="Name"/>
<Binding Path="ItemCount"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock FontWeight="Bold">
<TextBlock.Text>
<Binding Path="Items" Converter="{StaticResource converterSumPortions}" StringFormat="{}Total : {0} portions" />
</TextBlock.Text>
</TextBlock>
</DockPanel>
</Expander.Header>
<Expander.Content>
<ItemsPresenter />
</Expander.Content>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle> |
Partager