title: Bind Control as CommandParameter in KeyBinding
body: <p>I'm trying to send a Control as a ComandParamter so that I can set focus on it. These controls are in a GridViewColumn HeaderTemplate and tabbing cannot go across headers as far as I can tell. My research has led me to utilize <code>x:reference</code> because <code>ElementName</code> fails due to naming scope. The command is properly bound, it does run when I don't bind a CommandParameter. </p>
  
  <p>With the binding shown in xaml below, I receive this error:</p>
  
  <blockquote>
    <p>Attempt to reference named object(s) 'resourcetypeSrch' which have not
    yet been defined. Forward references, or references to objects that
    contain forward references, are not supported on directives other than
    Key.</p>
  </blockquote>
  
  <p>How can I bind the ComboBox with <code>x:Name resourcetypeSrch</code> to the TextBox KeyBinding CommandParameter?</p>
  
  <pre><code>&lt;GridViewColumn DisplayMemberBinding="{Binding Name }"&gt;
      &lt;GridViewColumn.HeaderTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;DockPanel&gt;
                  &lt;TextBlock Text="{StaticResource Name}" /&gt;
                  &lt;TextBox Text="{Binding DataContext.Foo, RelativeSource={RelativeSource AncestorType=Page}}"                                             
                           Style="{StaticResource SearchBox }" Width="200"&gt;
                      &lt;TextBox.InputBindings&gt;
                          &lt;KeyBinding Key="Tab" 
                                      Command="{Binding DataContext.SearchNavigationCmd, RelativeSource={RelativeSource AncestorType=Page}}"
                                      CommandParameter="{Binding {x:Reference resourcetypeSrch}}"/&gt;
                      &lt;/TextBox.InputBindings&gt;
  
                  &lt;/TextBox&gt;
              &lt;/DockPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/GridViewColumn.HeaderTemplate&gt;
  &lt;/GridViewColumn&gt;
  
  &lt;GridViewColumn Width="350" DisplayMemberBinding="{Binding ResourceTypeLookup.TypeName }"&gt;
      &lt;GridViewColumn.HeaderTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;DockPanel&gt;
                  &lt;TextBlock Text="{StaticResource ResourceType}" /&gt;
                  &lt;ComboBox x:Name="resourcetypeSrch" Width="300" HorizontalAlignment="Left" IsSynchronizedWithCurrentItem="True"
                        ItemsSource="{Binding DataContext.SrchResourceTypeLookups, RelativeSource={RelativeSource AncestorType=Page}, Mode=OneTime}" 
                        DisplayMemberPath="TypeName"
                        SelectedValuePath="Bar"
                        SelectedValue="{Binding DataContext.Fizz, RelativeSource={RelativeSource AncestorType=Page}}" &gt;
                  &lt;/ComboBox&gt;
              &lt;/DockPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/GridViewColumn.HeaderTemplate&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>