title: WPF Listbox style
body: <p>I was following this tutorial: 
  <a href="http://www.c-sharpcorner.com/uploadfile/dpatra/listbox-group-header-expand-and-collapse-in-wpf/" rel="nofollow">http://www.c-sharpcorner.com/uploadfile/dpatra/listbox-group-header-expand-and-collapse-in-wpf/</a></p>
  
  <p>And i tried to design my listbox with expanders.</p>
  
  <p>For some reason I'm getting something like this:</p>
  
  <pre><code>Title (expander)
   Tiltle(expander)
    Data
    Data
    Data
  </code></pre>
  
  <p>I don't know what is causing the double-grouping and I need some help.</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;ListBox Grid.ColumnSpan="3" Grid.Row="3"
           Name="lbInterfaces"  Background="Transparent" ItemsSource="{Binding InterfacesView }" ItemTemplate="{StaticResource InterfacesDataTemplate}" BorderBrush="Transparent"&gt;         
      &lt;ListBox.GroupStyle&gt;
          &lt;GroupStyle ContainerStyle="{StaticResource ContainerStyle}"/&gt;
      &lt;/ListBox.GroupStyle&gt;
  &lt;/ListBox&gt;
  
  &lt;Style x:Key="ContainerStyle" TargetType="{x:Type GroupItem}"&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate&gt;
                          &lt;Expander Header="{Binding Name}" IsExpanded="False"&gt;
                              &lt;ItemsPresenter /&gt;
                          &lt;/Expander&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  
  &lt;DataTemplate x:Key="InterfacesDataTemplate"
                DataType="ca:Interface"&gt;
              &lt;Grid&gt;
                  &lt;TextBlock Text="{Binding Path=Name}" MouseLeftButtonDown="interface_mouseDown"/&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>And in the view-model I have:</p>
  
  <pre><code>InterfacesView = CollectionViewSource.GetDefaultView(Interfaces);
  InterfacesView.GroupDescriptions.Add(new PropertyGroupDescription("Kind"));
  InterfacesView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
  </code></pre>
  
  <p>The Kind is a property inside the "interface" clss</p>