0
그룹, 항목, 하위 항목에 3 개의 포함 된 목록 상자가 있습니다.목록 상자 계층 구조
<ListBox Name="GroupItemsListBox"
ItemSource="{Binding EntityGroups"}>
<ListBox.ItemTemplate>
<DataTemplate>
<ItemsControl Name="ItemsListBox"
ItemSource="{Binding Items}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ItemsControl Name="SubItemsListBox"
ItemSource="{Binding SubItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name} />
</DataTemplate>
</ItemsControl.ItemTemplate>
</DataTemplate>
</ItemsControl.ItemTemplate />
</ItemsControl>
</DataTemplate>
<ListBox.ItemTemplate>
</ListBox>
마지막 목록 상자가 비어있는 경우도 있습니다. 가장 낮은 기존 ItemControl에서 SelectedItem을 처리하려고합니다. 그래서 가장 구체적인 물체가 선택되었을 때 관리 할 수 있습니다.
예를 들어 ItemGroup [1] .Items [0] .SubItem [2]을 클릭하면이 요소를 가져오고 ItemGroup [1] 또는 ItemGroup [1] .Items [0]은 가져 오지 않습니다.
어떻게하면됩니까?
시도해 주셔서 감사합니다. –