I have a TreeView which uses a HierarchicalDataTemplate to bind its data.
It looks like this:
I ran into this same problem. I needed to get to the TreeViewItem so that I could have it be selected. I then realized that I could just add a property IsSelected to my ViewModel, which I then bound to the TreeViewItems IsSelectedProperty. This can be achieved with the ItemContainerStyle:
Now if I want to have an item in the treeview selected, I just call IsSelected on my ViewModel class directly.
Hope it helps someone.