Single select Multiple TreeViewItems in a single control

This is my control at the moment:

<TreeViewItem Header="{Binding ParentName}"> <TreeViewItem Header="{Binding ChildName}" /> </TreeViewItem> 

It is supposed to be in a ListBox , but the catch is that I need to be able to select only the parent or child.

This is a simple concept, but I tried so much (wrapping in ListBoxItem. Using extenders and changing visibility manually), but nothing worked. ListBox treats instances of this control as one when it is actually two. Any ideas?

+4
source share
1 answer

Therefore, the TreeViewItems solution needs to be placed in the TreeView.

0
source

Source: https://habr.com/ru/post/1493932/


All Articles