title: wpf listview lost the focus
body: <p>I have some strange behavior of ListView control in WPF.</p>
  
  <p>We are developing application in C#.</p>
  
  <p>I created ListView with some items and set SelectedIndex to some index in
  the middle of its list. Then I clicked mouse at any place on the ListView and
  then navigate with Up/Dows keyboard keys, everything works perfectly. But If
  I move focus to another control and then tries to set focus back to ListView
  control programmatically, then I'm getting the problem.</p>
  
  <p>The ListView gets the focus, but when Iâ€™m trying to navigate with the
  keyboard, current selection will be canceled and the first item will be
  selected and navigation will start from the first item in list.</p>
  
  <p>I'm setting focus to ListView control by calling to its .Focus() method.</p>
  
  <p>It looks like even ListView control in focus, but no items actually in
  focus, even if SelectedIndex has some valid values.</p>
  
  <p>Please, help me! How can I set focus to ListView control programmatically to
  prevent such behavior?</p>
  
  <p>i find out that my listview selected index is different from the focused item .
  who ???</p>
  
  <p>in selectedindex_changed event i set the selected index to the fix item (5) , but when i press arrow keys the item was changed . that mean the selected index is fixed to 5 but the current item(shown with a dot border around it ) moved to the arrow key location .
  anyway my selecteditem is fix to 5 , but my scrollviews moves to position that current item is .</p>
  
  <p>this code is in listView1_SelectionChanged:
  listView1.SelectionMode = SelectionMode.Single;
              listView1.SelectedIndex = 5;</p>
  
  <p>my listview has a modified view :
          
              
                  
                              
                  
              
          </p>
  
  <pre><code>    &lt;l:PlainView x:Key="tileView"
              ItemTemplate="{StaticResource centralTile}"
              ItemHeight="120" ItemWidth="130" /&gt;
  </code></pre>
  
  <p>i dont know about the problom any more .</p>
  
  <p>regards</p>