Difference between KeyboardNavigationMode Contained and Cycle?
Asked Answered
I

1

15

Short question - what is the real difference put in easy and understandable words?..

Extracts from MSDN:

  • Contained - Depending on the direction of the navigation, focus returns to the first or the last item when the end or the beginning of the container is reached, but does not move past the beginning or end of the container.
  • Cycle - Depending on the direction of the navigation, the focus returns to the first or the last item when the end or the beginning of the container is reached. Focus cannot leave the container using logical navigation.

The difference is in the last part of the description of those modes. But I cannot understand it. Can anyone explain it in a more humane way?

Inness answered 9/12, 2010 at 11:34 Comment(0)
C
18

The KeyboardNavigation class defines three attached properties that allow the modification of each of the navigation modes:

KeyboardNavigation.TabNavigation, KeyboardNavigation.DirectionalNavigation, KeyboardNavigation.ControlTabNavigation

Each of these properties defines six possible values.These values specifies how the navigation can be done in a list control(eg:ListBox,listview)

for instance;

KeyboardNavigation.DirectionalNavigation="Contained"

is used to indicate that when i press the down or up arrow in the keyboard to navigate between items in a list,the navigation stops at the last item or first item,then we have to use the opposite button to navigate further up or down.

KeyboardNavigation.DirectionalNavigation="Cycle"

is used to indicate that when i press the down or up arrow in the keyboard to navigate between items in a list,the navigation continues from the top or bottom item in a cyclic manner

same is the case with TabNavigation which indicate the navigation mode when we press the tab button in a list

Clinton answered 9/12, 2010 at 11:51 Comment(1)
Thanks! That was very clear and easy to understand. /* Added after trying out */ Oh my god, that is so cool! :)Inness

© 2022 - 2024 — McMap. All rights reserved.