<Style x:Key="ContainerStyle1" TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <StackPanel> <Expander IsExpanded="{Binding IsSelected, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" x:Name="Xp11" Style="{DynamicResource ExpanderStyle1}" Margin="0,3,0,3" Foreground="White" FontSize="20" Width="255" BorderBrush="White" > <Expander.Header> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock Foreground="White" FontSize="7" Text="{Binding ItemCount}"/> <TextBlock Foreground="White" Text="{Binding Name}"/> </StackPanel> </Expander.Header> <Expander.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFABA8A8" Offset="0.337"/> <GradientStop Color="#3A0A0A0A" Offset="0.609"/> </LinearGradientBrush> </Expander.Background> <ItemsPresenter/> </Expander> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="Content" Value="{x:Null}"/> </Style.Triggers> </Style>