I have a treeview with checkboxes for each item using a DataTemplate.
The ItemsControl you are fetching might be the StackPanel, or the Grid. You should be able to access the Checkbox through the event sender, and navigate up to the TreeViewItem and TreeView and use IndexOf
.
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
CheckBox cb = (CheckBox)sender;
StackPanel sp = (StackPanel)cb.Parent;
Grid g = (Grid)sp.Parent;
ContentPresenter cp = (ContentPresenter)VisualTreeHelper.GetParent(g);
IList l = (IList)myTreeView.ItemsSource;
object o = cp.Content;
MessageBox.Show(l.IndexOf(o).ToString());
}