ListBox에서 사용자 정의 컨트롤을 사용하고 탭 키를 사용하여 포커스를 지정하면 사용자 정의 컨트롤 대신 컨트롤의 TextBox에 포커스를 맞추고 싶습니다. 내가 어떻게 해?ListBox에서 사용자 정의 탭 컨트롤 DataTemplate
제 컨트롤에는 다른 UI 요소가 있기 때문에 코드가 단순 해졌습니다.
사용자 컨트롤 코드 :
<Grid>
<TextBox Name="txtFreeTextDescription" Style="{StaticResource TextBoxStyleLargeDynamic}" Text="{Binding Description, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
</Grid>
목록 상자 코드 : 링크 아래
<ListBox Name="lsbItems" DataContext="{Binding}" KeyboardNavigation.TabNavigation="Local">
<ListBox.ItemTemplate>
<DataTemplate>
<local:SectionDynamicItem x:Name="ucSectionDynamicItem" Description="{Binding SectionItem.Description}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
감사합니다 한 트릭 잘에게 ! –