I have a WPF ListView control, ItemsSource is set to an ICollectionView created this way:
var collectionView =
System.Windows.Data.CollectionViewSource.Ge
Cheeso, in your previous answer you said:
But there's also a second problem with that - it doesn't work right after setting the SelectedItem. ItemContainerGenerator.ContainerFromItem() always seems to return null.
An easy solution to that is to not set SelectedItem at all. This will automatically happen when you focus the element. So just calling the following line will do:
((UIElement)this.listView1.ItemContainerGenerator.ContainerFromItem(thing)).Focus();