I send a FrameworkElement object through to a method in my ViewModel which is responsible for creating a new item in the TreeView.
public void NewFile(FrameworkElement frameworkElement)
When I debug, I can see what is in the frameworkElement's SelectedItem, but when I want to get hold of it, e.g.
frameworkElement.SelectedItem.ID
then I can't. Intellisense doesn't give me that option. Why not? And then of course, how do I get hold of the SelectedItem's ID?
I managed to get it to work as follows, based on Henk Holterman's comment: