Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect data binding completed in WPF

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.

like image 976
Graeme Avatar asked May 05 '09 14:05

Graeme


1 Answers

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.

like image 199
Bryan Anderson Avatar answered Sep 19 '22 15:09

Bryan Anderson