title: WPF ListBox and large amound of data
body: <p>I need to display a large amount of data (thousands of items) in a ListBox however it takes some times and the UI is not responsive until the whole items are displayed in the ListBox.</p>
  
  <p>The ItemsSource of the ListBox is bound the an CollectionView.</p>
  
  <p>I know the benefit of using the VirtualizingStackPanel but I insist to use a WrapPanel.</p>
  
  <p>I've searched over the internet and found some VirtualizedWrapPanels but they have the same issue which is they don't allow the VirtualizingWrapPanel to grow to whatever size it likes and I have to set both Width and Height for them.</p>
  
  <p>Now I need to know what other options are out there for me to do the job? What can I do so that the ListBox loads and displays this large amount quickly.</p>
  
  <p>Please let me know if I haven't explained m
  y issue clearly.
  Any help is appreciated. Thanks in advance.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>This is the relevant code</p>
  
  <pre><code>    public ObservableCollection&lt;T&gt; Items
      {
          get { return _items; }
          set
          {
              if (_items == value)
                  return;
  
              _items = value;
              OnPropertyChanged(() =&gt; Items);
          }
      }
  </code></pre>
  
  <p>I instantiate the ObservableColelction in the LoadData method of the ViewModel</p>
  
  <pre><code>   _items = _service.Select();
  </code></pre>
  
  <p>and the CollectionView is instantiated in this way</p>
  
  <pre><code>    ICollectionView cv = new CollectionViewSource() { Source = Items }.View;
  </code></pre>
  
  <p>and the xaml code of the ListBox</p>
  
  <pre><code>            &lt;ListBox
                  x:Name="Items"
                  ItemsSource="{Binding CollectionView}"
                  Padding="10,10,10,10"
                  SelectionMode="Single"
                  VerticalAlignment="Top"
                  IsSynchronizedWithCurrentItem="True"&gt;
  
                  &lt;ListBox.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;WrapPanel Orientation="Vertical" Height="480" /&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ListBox.ItemsPanel&gt;
  
              &lt;/ListBox&gt;
  </code></pre>