title: Let ListView scroll to selected item
body: <p>I have a WinRT/C#/XAML app with a view that has a vertical ListView of items. Depending on the amount of items the ListView shows a vertical scrollbar. Here's the XAML definition:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;CollectionViewSource
          x:Name="myViewSource"
          Source="{Binding myViewModel.Items}" /&gt;
  &lt;/UserControl.Resources&gt;
  ...
  &lt;ListView
      x:Name="myListView"
      ItemsSource="{Binding Source={StaticResource myViewSource}}"
      SelectedItem="{Binding SelectedItem, Mode=TwoWay}"&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Now everytime I navigate to this view, the selected item of the ListView is chosen by setting the databound SelectedItem property in the view model from code behind (<code>OnNavigatedTo</code>). My problem: the ListView doesn't scroll automatically to this selected item. The scrollbar remains at the top of the ListView and the user has to scroll manually to see the selected item.</p>
  
  <p>I tried to execute <code>myListView.ScrollIntoView(MyViewModel.SelectedItem);</code> after setting the SelectedItem in the code behind (in <code>OnNavigatedTo</code>), but it doesn't work. The scrollbar remains at the top.</p>
  
  <p>I'm aware of this thread on SO: <a href="https://stackoverflow.com/questions/11325384/scroll-winrt-listview-to-particular-group">Scroll WinRT ListView to particular group</a> .
  This seems to be a similar problem. But when I walk the visual tree of the ListView manually or with the WinRT XAML Toolkit, it doesn't find a ScrollViewer (returns null instead).</p>