Accessing child of ListBoxItem
问题 I have a ListBox with a DataTemplate that looks like this: <ListBox Name="listBox"> <ListBox.ItemTemplate> <DataTemplate DataType="x:Type local:NumericIconDefinition"> <Grid> <ComboBox Name="IconComboBox"/> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> I would like to fetch the ComboBox instance in order to manipulate it in the code behind. I found a blog post that explained the process of fetching the ListBoxItem: ListBoxItem lbi = (ListBoxItem)listBox.ItemContainerGenerator