Is there a way to make Focus Navigation (controlled by the Tab key or MoveFocus) wrap inside this container? I have included code that demonstrates this problem below. The easiest way to make a Tab to move focus from TextBox“Charlie” to TextBox“Able” (and vice versa for Shift + Tab to TextBox“Able”), and not move it to MenuItem“Alpha”?
MoveFocus
TextBox
MenuItem
<Window x:Class="NavWrapExample.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <DockPanel LastChildFill="True"> <Menu DockPanel.Dock="Top"> <MenuItem Header="Alpha" /> <MenuItem Header="Bravo" /> <MenuItem Header="Charlie" /> </Menu> <StackPanel> <TextBox Text="Able" /> <TextBox Text="Baker" /> <TextBox Text="Charlie" /> </StackPanel> </DockPanel> </Window>
Use the Ke property yboardNavigation.TabNavigation , for example:
<StackPanel KeyboardNavigation.TabNavigation="Cycle"> <TextBox Text="Able" /> <TextBox Text="Baker" /> <TextBox Text="Charlie" /> </StackPanel>
Found the answer to Mark Smith's blog .
, , , : , , . , FocusManager :
<StackPanel FocusManager.IsFocusScope="True"> <!-- Controls go here... --> </StackPanel>
Source: https://habr.com/ru/post/1715113/More articles:Passing an object from F # to a C # method that takes it as an out parameter doesn't work? - pass-by-referenceКак создать многомерный массив из иерархически хранимых данных SQL с использованием метода списка смежности? - oopCreating C ++ BackTraces on OS / X (10.5.7) - c ++Drupal: staying in organizations with module changes - phpFirefox jQuery error finding position () div - jqueryDouble click prevention with server side validation - asp.netAsynchronous result descriptor to return to callers - c #stretchableImageWithLeftCapWidth: topCapHeight не работает в initWithCoder: подкласса UIImageView - objective-cQApplication without display - c ++Help with .NET Search Architecture C # - c #All Articles