title: WPF list view performance - static vs. databound items
body: <p>I have two simple examples to demonstrate my problem. </p>
  
  <p>When I run scenario 1, I am able to navigate the list view as normal, using the extended selection mode to choose items.</p>
  
  <p>When I run scenario 2, I find that navigating my list view is slow, and selecting items doesn't function correctly. It's difficult to explain, however, the jist of it is, clicking doesn't select the item under the cursor most of the time.</p>
  
  <p>Any ideas?</p>
  
  <p>1.Statically define a list view with 1000 items</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.StaticListView"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="StaticListView" Height="300" Width="300"&gt;
      &lt;Grid&gt;
          &lt;ListView Name="listView" SelectionMode="Extended"&gt;            
              &lt;ListViewItem Content="bla" /&gt;            
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
              &lt;ListViewItem Content="bla" /&gt;
  ....
  </code></pre>
  
  <p>2.Define a list view that is databound to a list of 1000 items</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Shapes;
  
  namespace WpfApplication1
  {
      /// &lt;summary&gt;
      /// Interaction logic for TestManyItemsInListView.xaml
      /// &lt;/summary&gt;
      public partial class BoundListView : Window
      {
          public BoundListView()
          {
              InitializeComponent();
              List&lt;string&gt; items = new List&lt;string&gt;();
              AddItems(items);
              listView.ItemsSource = items;
          }
  
          public void AddItems(List&lt;string&gt; items)
          {
              while (items.Count &lt; 1000)
              {
                  items.Add("bla");
              }
          }
      }
  }
  </code></pre>