I set 'VirtualizingStackPanel.IsVirtualizing' to true and 'VirtualizingStackPanel.VirtualizationMode' to 'Recycling', because the items in my ListView are too many. The SelectionMode of the ListView is Extended, the 'IsSelected' property of the ListViewItem is bound to 'IsSelected' property of my model, bind mode is two way.
When I want to use Ctrl+A to select all of the items, it only select part of the items, so I use KeyBinding to write the select all method like below:
<KeyBinding Command="{Binding SelectAllCommand}"
Modifiers="Control"
Key="A"/>
SelectAll method will loop the ItemsSource collection and set each of the item's IsSelected property to true. But it also leads to something unexpected. When all of the items are selected, I scroll the scrollbar to the bottom and it will load more items to the ListView, I single click one item and the expected is all other items are unselected, only select this item. But, it seems not unselect other items.
Anybody can help?