WPF Is there a way to get the container for an item on a selectionchanged
event?
Normally I would either search the visual tree or use the
itemcontainergenerator to get the container. However, in wpf
hierachicaldatatemplates have an itemcontainergenerator for each level,
and it doesn't appear as if selectionchanged's event arguments contain the
actual parent item or the container of the item.
I can code around this by triggering on mousedown of an actual
treeviewitem. However, it seems odd that I can't use the selectionchanged
event of the treeview to access the treeview's itemcontainers around the
selected item.
No comments:
Post a Comment