In my WPF application, I have a treeview. This treeview is bound to a custom class (i.e. not TreeviewItems). So I use a hierarchicalDataTemplate to control how the tree renders.
When my mouse is over a tree view item, I would like to get the Data Object (i.e. my custom class instance) associated with the tree view item. How do I do this?
To clarify - I need the data object (not the UIElement) under the mouse cursor.
Assume my method to retrieve the data object has the following signature:
private object GetObjectDataFromPoint(ItemsControl source, Point point)
{
...
}