I'm having trouble finding the index number of a selected child in a WPF treeview. What I have so far is attached. I'm not married to looping through each node either. If there's a simple way to remove a selected child node, I'd begrateful if someone would share.
Thanks in advance!
Private Sub Delete_Node_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Delete_Node.Click
Dim TreeItems As ItemCollection = Tree.Items
Dim index As Integer = 0
' loops through all parent nodes
For Each nodes As TreeViewItem In TreeItems
'loops through the children of the parent
For i = 0 To nodes.Items.Count - 1
' need something here to find if child node is selected and set the index number
' index = (the node that's selected)