title: UWP - Prevent default ItemsControl focus handling
body: <p>I have an ItemsControl with IsTabStop="False". When I click below the last item in the ItemsControl, the first item in the ItemsControl is focused. </p>
  
  <p>I want to set focus to the last item in the list instead. With the following code, focus is set to the last child of the ItemsControl... until I release the mouse at which point the first item becomes focused. Which event/override do I need to handle instead?</p>
  
  <pre><code>protected override void OnPointerPressed(PointerRoutedEventArgs e)
  {
    e.Handled = true;
    var item = VisualTreeHelper.GetChild(Items.ItemsPanelRoot.Children.Last() as DependencyObject, 0) as ContentControl;
    (item.Content as Control).Focus(FocusState.Keyboard);
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here's some sample code that illustrates the problem.</p>
  
  <pre><code>&lt;ScrollViewer IsTabStop="False"&gt;
    &lt;ItemsControl IsTabStop="False"&gt;
      &lt;ItemsControl.ItemTemplate&gt;
        &lt;DataTemplate&gt;
          &lt;TextBox Text="{Binding}" HorizontalAlignment="Stretch" /&gt;
        &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
      &lt;ItemsControl.Items&gt;
        &lt;x:Int32&gt;1&lt;/x:Int32&gt;
        &lt;x:Int32&gt;2&lt;/x:Int32&gt;
        &lt;x:Int32&gt;3&lt;/x:Int32&gt;
      &lt;/ItemsControl.Items&gt;
    &lt;/ItemsControl&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>When I click empty space below textbox 3, textbox 1 is focused. I want to focus textbox 3 instead.</p>
  
  <p><a href="https://i.stack.imgur.com/QUAlL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QUAlL.png" alt="enter image description here"></a></p>