title: Bind to ItemsControl's DataContext from inside an ItemTemplate
body: <p>I have an ItemsControl whose for the ItemTemplate DataTemplate contains a Button. I want the Command on the button to bind to a Command on the DataContext of the ItemsControl, not the ItemTemplate. I think the solution has to do with using RelativeSource, but my attempts so far have failed:</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding Games}"&gt;        
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Button Command="{Binding Path=GameSelectedCommand, Source={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}}" 
                      CommandParameter="{Binding}" 
                      Style="{StaticResource MenuButtonStyle}" 
                      Content="{Binding Name}"/&gt;    
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>How can I get the Button to bind to the GameSelectedCommand of the ItemsControl's DataContext object?</p>