Wpf – How to detect data binding completed in WPF

data-bindingtreeviewwpf

When I select an item on my treeview, there is a notable time gap from my viewmodel class being instantiated to the view refreshing and the treeview node being hi-lit.

I need to show a wait cursor during this time – I've tried wrapping the code that instantiates my viewmodel class, but the cursor is back to an arrow a couple of seconds before the whole data binding seems to finish and the node gets hi-lit. Is there some event that tells me when the binding is finished, or when the node is hi-lit ?

This is nothing to do with expanding nodes, simply selecting top-level nodes.

Thanks for any help.

Best Solution

The Loaded event on the desired TreeView control will happen after all of the bindings have been set up. I think it happens before everything has been drawn though so it might not be exactly what you need.