If I have a list of Cars bound to a ListBox
.
I now want to implement that the first item is initially focused, additionally I want to implement a full keyboard navigation between the displayed ListBox-items, therefore I need access to the virtually created item controls.
The problem is that itemStack.Items[i]
returns the Car
itself and not the CarEditControl
. How can I get the virtually created item?
<ObjectDataProvider x:Key="ItemSource" d:IsDataSource="True"/>
<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
<StackPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
<DataTemplate x:Key="ItemCollectionTemplate">
<StackPanel>
<custom:Item x:Name="item" Car="{Binding Path=.,Mode=OneWay}" />
</StackPanel>
</DataTemplate>