title: WPF Command Binding to ancestor property
body: <p>I have a doubt about binding to an ancestor property in WPF. My situation is: my window has a view model as data context with all the commands as ICommand properties. I have a list of checkboxes as follows:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding CurrentCustomer.SuppiersSelection}"&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;CheckBox FontSize="16" Content="{Binding Path=Supplier.Company}" 
                        IsChecked="{Binding Path=Selected}"&gt;&lt;/CheckBox&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>The question is: I want that each checkbox has a command bound to it, so that when a supplier is checked or unchecked the relationship between customer and supplier is automatically saved. My problem is that the command properties are on the Window Data Context and this checkboxes is using as data context the ItemsSource of ItemControl. How do I bind to the property on the Window Data Context?</p>
  
  <p>Thanks in advance for your help.</p>