title: How to enable UI virtualization in Standard WPF ListView
body: <p>I'm using .NET 4.5/VS2012, and I have a ListView looks something like this</p>
  
  <pre><code>&lt;ListView 
      VirtualizingPanel.IsContainerVirtualizable="True"
      VirtualizingPanel.IsVirtualizing="True"
      VirtualizingPanel.IsVirtualizingWhenGrouping="True"
      Grid.Row="1"
      Name="eventLogList"
      Margin="5,0,5,0"
      BorderBrush="Black"
      BorderThickness="2"
      ItemsSource="{Binding EventLogs}"
      SelectedItem="{Binding SelectedEventLog}"
      local:ListViewSorter.CustomListViewSorter="EventLogViewer.UI.EventLogItemComparer"
      SelectionMode="Single"&gt;
  
      &lt;ListView.GroupStyle&gt;
          &lt;GroupStyle HidesIfEmpty="False"&gt;
              &lt;GroupStyle.ContainerStyle&gt;
                  &lt;Style TargetType="GroupItem"&gt;
                      &lt;Setter Property="Template"&gt;
                          &lt;Setter.Value&gt;
                              &lt;ControlTemplate TargetType="GroupItem"&gt;
                                  &lt;Expander IsExpanded="True"&gt;
                                      &lt;Expander.Header&gt;
                                          &lt;TextBlock FontSize="20" TextWrapping="Wrap" Margin="0,10,0,5" &gt;
                                          &lt;Bold&gt;&lt;TextBlock Text="{Binding Name}"/&gt;&lt;/Bold&gt; - &lt;TextBlock FontSize="20" Text="{Binding ItemCount}"/&gt; logs
                                      &lt;/TextBlock&gt;
                                      &lt;/Expander.Header&gt;
                                      &lt;ItemsPresenter/&gt;
                                  &lt;/Expander&gt;
                              &lt;/ControlTemplate&gt;
                          &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                  &lt;/Style&gt;
              &lt;/GroupStyle.ContainerStyle&gt;
          &lt;/GroupStyle&gt;
      &lt;/ListView.GroupStyle&gt;
      &lt;ListView.View&gt;
          &lt;GridView&gt;
              &lt;GridViewColumn 
                  Header="event id"
                  Width="120"
                  DisplayMemberBinding="{Binding EventID}" /&gt;
              &lt;GridViewColumn 
                  Header="level"
                  Width="160"
                  DisplayMemberBinding="{Binding Level}" /&gt;
              &lt;GridViewColumn 
                  Header="server" 
                  Width="160"
                  DisplayMemberBinding="{Binding Server}" /&gt;
              &lt;GridViewColumn 
                  Header="log name" 
                  Width="160"
                  DisplayMemberBinding="{Binding LogName}" /&gt;
              &lt;GridViewColumn 
                  Header="source"
                  Width="240"
                  DisplayMemberBinding="{Binding Source}" /&gt;
              &lt;GridViewColumn 
                  Header="logged"
                  Width="240"
                  DisplayMemberBinding="{Binding Logged}" /&gt;
          &lt;/GridView&gt;
      &lt;/ListView.View&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>But still the performance is not improving at all. I found an example using ListBox, but how to virtualize a ListView? I struggled quite a bit. 
  I heard that with grouping, the virtualization is turned off in previous version of WPF, but with .NET 4.5, WPF has a <code>IsVirtualizingWhenGrouping</code> property, I already set it to <code>True</code>. </p>
  
  <p><strong>Update</strong>: The culprit is custom styling, after removing it, the list view runs smoothly like butter</p>