WPF ListView Keyboard Navigation Task

I have a list similar to this

ListView:
---------

  • Mango
  • Orange
  • Grape
  • Grape
  • Grape
  • Apple
  • Strawberry

Whenever I move using downarrow, BlueHighlight stops in the first Grapes, the dotted rectangle starts with the second grape and pauses in the third grape, then BlueHighlight resumes with Apple. It seems weird, and it gets weirder when the navigation is up. It jumps from Apple to Orange or mango.

Is it because of virtualization?
Only duplicate data (grapes) seems to create a problem. Any help?

+3
3

- . - .

, , . , , , . , .

, , ObservableCollection. :

coll.Add(fruit);

coll.Add(new FruitWrapper(fruit));

ListBox ItemTemplate ContentPresenter, (, <ContentPresenter Content="{Binding Fruit}" />).

+4

. , .

- , ListViewItem, .

, Grapes, 3 ListViewItem.

+2

You have the same "Grapes" object ObservableCollection3 times, I mean an object with the same link. And Listbox is a mess with that. Each element must be a non-cyclic instance.

+1
source

Source: https://habr.com/ru/post/1732982/


All Articles