The following bit of code works on Vista as expected (focus is moved down the ListView), but on XP SP3 (with .Net 3.5 SP1 on both) it moves only between the first two items of the ListView.
if (myListView.SelectedItem != null) {
IInputElement orig = FocusManager.GetFocusedElement(this);
FocusManager.SetFocusedElement(this, myListView);
ListViewItem lvi = myListView.ItemContainerGenerator.ContainerFromItem(myListView.SelectedItem) as ListViewItem;
TraversalRequest down = new TraversalRequest(FocusNavigationDirection.Down);
Boolean result = lvi.MoveFocus(down);
Console.WriteLine(result.ToString());
FocusManager.SetFocusedElement(this, orig);
}
I'm calling this code from the window's previewkeydown event, when the focus is in a textbox. I'm digging into the framework now to try and find what is different between XP and Vista inside of MoveFocus(). I feel like I'm doing web development again, testing browsers for quirks...