項目コントロール内で作成した動的コンボボックスのグループから選択した値を取得しようとすると、この問題が発生しました。これをよりよく説明するために、xaml コードを示します。
<ItemsControl Name="ItemsControlP"
Width="120"
Margin="5"
ItemsSource="{Binding ElementName=personWindow, Path=DataContext.City}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ComboBox Height="20"
DisplayMemberPath="Name"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding ElementName=personWindow, Path=DataContext.Person}"
SelectedIndex="0"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
都市と人物は ObservableCollection タイプであるため、都市ごとにコンボボックスが表示され、各コンボボックスには人物のリストが含まれているため、各コンボボックスで選択した値をキャッチする必要があります。それを行う方法はありますか?