title: How to databind to a property on a collection behind a collectionviewsource?
body: <p>I currently have a collection with a HasChanges property on it (each object in the collection also has its own HasChanges property) and the collection is the source of my CollectionViewSource.</p>
  
  <p>When I try to databind the HasChanges property of the collection behind the CollectionViewSource to one of my custom controls, it binds to the HasChanges property of the currently selected object, instead of HasChanges property of the CollectionViewSource's source collection.  Is there a way that I can explicitly tell the binding to look on the collection object rather than the objects in the collection?</p>
  
  <p>My code looks something like this:</p>
  
  <pre><code>&lt;Window x:Class="CollectionEditWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:Local="clr-namespace:My.Local.Namespace;assembly=My.Local.Namespace"&gt;
      &lt;Window.Resources&gt;
          &lt;CollectionViewSource x:Name="CVS" x:Key="MyCollectionViewSource" /&gt;
      &lt;/Window.Resources&gt;
  
  &lt;Local:MyCustomControl HasChanges="{Binding HasChanges, Source={StaticResource 
                           MyCollectionViewSource}}"&gt;
  &lt;!-- Code to set up the databinding of the custom control to the CollectionViewSource--&gt;
  &lt;/Local:MyCustomControl&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Thanks.</p>