title: XAML detect if listview item is focused or not
body: <p>I am trying to detect which item in a listview is focused, but I am not getting the events detected. I am developing for Xbox One UWP, so I cannot use mouse or keyboard events, only focus can be used. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;ListView.ItemTemplate&gt;
      &lt;DataTemplate&gt;
          &lt;StackPanel Orientation="Vertical" GotFocus="StackPanel_GotFocus" &gt;
              &lt;StackPanel Name="Imagestack" Orientation="Horizontal"&gt;
                  &lt;Image Source="{Binding Image}" Height="144" Width="256" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;/StackPanel&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;TextBlock Text="{Binding Title}" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
              &lt;/StackPanel&gt;
          &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  &lt;/ListView.ItemTemplate&gt;
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>private void StackPanel_GotFocus(object sender, RoutedEventArgs e)
  {
      Debug.WriteLine("Image focus");
      Image img = sender as Image;
      Bgimage.Source = img.Source;
  }
  </code></pre>