Inspired by this post, I’m trying to use a TreeView inside the AutoCompleteBox’s popup in order to show hierarchical data.
Here’s what i did:
-
I Made my own TreeView that implements ISelectionAdapter (not sure it’s perfect)
-
Edit AutoCompleteBox template and change the selector to my treeview
-
Try Bind my ViewModel to it
Unfortunately this is not working.
i checked my new TreeView with the same binding to the same object and it works prefectly when it’s outside of a AutoCompleteBox template.
Any idea? any special way to implement ISelectionAdapter for treeview? did i missed something?
couldn’t find any example for it on the web…
Thanks.
I managed to write it eventually.
Made a custom control for it. it still need to be refined, but it works good:
Generic.xaml :
AutoCompleteTreeView.cs:
TreeViewSelectionAdapter.cs:
Using the control:
The hierarchy objects: