title: How can I force focus into the items of an ItemsControl?
body: <p>Here's a screenshot of my UI.
  <img src="https://i.stack.imgur.com/se5RZ.png" alt="enter image description here"></p>
  
  <p>Everything's bound to a list of Question objects:</p>
  
  <pre><code>class Question
  {
      public Answer[] Answers { get; set; }
      public string Text { get; set; }
  }
  
  class Answer
  {
      public bool IsSelected { get; set; }
      public string Text { get; set; }
  }
  </code></pre>
  
  <p>It's for an example I'm writing for a friend, and I'm still a relative MVVM newbie. (I know it's "not right" to have a UI concept like IsSelected on Answer, but it works without confusing the friend.)</p>
  
  <p>Anyway, the left side's obviously a ListBox with the collection as its item source. The right side's a ContentPresenter with this snipped DataTemplate:</p>
  
  <pre><code>&lt;DataTemplate x:Key="question" DataType="{x:Type local:Question}"&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt; ...  &lt;/Grid.RowDefinitions&gt;
  
          &lt;TextBlock Text="{Binding Text}" /&gt;
  
          &lt;ItemsControl Grid.Row="1"
                        ItemsSource="{Binding Answers}" &gt;
              &lt;ItemsControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;RadioButton Content="{Binding Text}"
                                   GroupName="Answer"
                                   IsChecked="{Binding IsSelected}"/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ItemsControl.ItemTemplate&gt;
          &lt;/ItemsControl&gt;
      &lt;/Grid&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>I've got input bindings set up so PageUp and PageDown move through the questions. When the question is changed, I'd like one of the radio buttons on the right (preferably the selected one, if any at all) to be focused. The goal is for the user to use up/down arrow keys to select answers and PageUp/PageDown to move between questions.</p>
  
  <p>I can tab into the radio buttons and the arrow keys work, but when I push Space to select an answer focus moves back to the listbox. Honestly I could do without the listbox getting focus at all. Setting Focusable to false seems to keep my focus inside the radio buttons, but even if I set IsTabStop to False the Tab key can still get focus inside the listbox.</p>
  
  <p>In bad old WinForms, I'd have a SelectedIndexChanged handler for the list box that found the first radio button and focused it, along with GotFocus handlers to try and toss away focus like a hot potato. Since the radio buttons are part of a template, I don't see a clear or elegant path to do that. How can I get the behavior I want? "Redesign your UI" is an acceptable answer if it gets the job done, but I am hoping for a solution with minimal code-behind; it reminds me too much of WinForms.</p>