title: WPF CollectionViewSource Multiple Views?
body: <p>I've written a Custom WPF Control with search extension, let's name it <code>MyControl</code>.
  The Control is a descendent of an <code>ItemsControl</code>  class.</p>
  
  <p>So I feed the the data source to it like this:
  </p>
  
  <p>The control itself uses </p>
  
  <pre><code>protected override void OnItemsSourceChanged(System.Collections.IEnumerable oldValue, System.Collections.IEnumerable newValue)
  {
      if (newValue != null)
      {
          ICollectionView view = CollectionViewSource.GetDefaultView(newValue);
          view.Filter += this.FilterPredicate;
      }
  
      if (oldValue != null)
      {
          ICollectionView view = CollectionViewSource.GetDefaultView(oldValue);
          view.Filter -= this.FilterPredicate;
      }
  
      base.OnItemsSourceChanged(oldValue, newValue);
  }
  </code></pre>
  
  <p>to filter the view of the source collection (thus displaying it in an inner ListBox).</p>
  
  <p>Now suppose we have 10 of these MyControls defined in XAML with the same DynamicSource.
  The problem is that if one of them applies the Filter on the source collection, it will affect all other instances too. </p>
  
  <p>How would you change the Control to avoid this behaviour ?</p>