title: Is there a way to increase performance on my simple textfilter?
body: <p>I'm writing a filter that will pick out items. I have a list of Objects. The objects contain a number, name and some other irrelevant items. At the moment, the list contains 200 items. When typing in a <code>textbox</code>, i'm looking if the string matches a part of the number/name of the objects in the list. If so, add them to the <code>listbox</code>. Here's the code for my textbox textchanged event : </p>
  
  <pre><code>private void txtTelnumber_TextChanged(object sender, TextChangedEventArgs e)
      {
          lstOverview.Items.Clear();
          string data = "";
          foreach (ucTelListItem telList in _allUsers)
          {
              data = telList.User.H323 + telList.user.E164;
              if (data.Contains(txtTelnumber.Text))
                  lstOverview.Items.Add(telList);
          }
      }
  </code></pre>
  
  <p>I sometimes see a little delay when entering a character, especially when i go from 4 records to 200 records (so when i had a filter and 4 records matched, and i backspace and the whole list appears again).
  My list is a list of usercontrols, cause I found it takes less time to load the usercontrols from a list, then to have to initialize a new usercontrol each time.</p>
  
  <p>Can I do something about the code, or is it just adding the <code>usercontrol</code> the <code>listbox</code> that causes the small delay (small delay = &lt;1 sec)?</p>
  
  <p>Thanks in advance.</p>
  
  <p><em>Edit</em>
  I've edited post, it's wpf. And putting items in a list and setting the itemssource isn't solving the problem.</p>