我有一个错误,无法修复无法选中的WPF应用中的超链接。你前进时会跳过控件,但是如果你向后跳转(shift-tab),链接将会得到焦点!
窗口设置有多个面板:链接所在的顶部面板(usercontrol),下方的主面板和表单内容,以及右侧的工具栏。 Tabbing fwd将使所有这些控件都正常但跳过顶部面板。如果你换班,你会得到超链接。
帮助?
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition x:Name="gridRowBanner" Height="71"/>
<RowDefinition x:Name="gridRowFormContent"/>
</Grid.RowDefinitions>
<UserControl FocusManager.IsFocusScope="True" KeyboardNavigation.TabNavigation="Continue"/>
<TabControl Grid.Row="1" TabStripPlacement="Left" >
usercontrol有这个项目,当你前进时没有得到焦点,但是当你回到时:
<TextBlock x:Name="textParentWorkItem" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" >
<Hyperlink Cursor="Hand" Click="Hyperlink_Click" x:Name="linkParentWorkItem" KeyboardNavigation.IsTabStop="True" >
<InlineUIContainer>
<TextBlock Text="{Binding ParentWorkItem[0].DisplayName, Mode=OneWay}" />
</InlineUIContainer>
</Hyperlink>
</TextBlock>
答案 0 :(得分:0)
想出来。我在UserControl上有这个:
FocusManager.FocusedElement =“{Binding ElementName = tabItemGeneral}”
删除它并集中精力。