Verify how many nodes are rendered in the diagram

The application I am working with is a organization node diagram using TreeView layout. Our project has around 5000+ nodes. I made some changes to a sorting logic since we want children of certain node are rendered in a certain order. I would like to verify that this change does not miss any node to be rendered in these type of large project. Is there a property I can check to see how many nodes are rendered on the UI? I just need it for testing and debug reason.

Thanks for any help on this.

I assume you have set TreeLayout.Sorting and .Comparer.

Diagram.Nodes.Count() should get you the current number of Nodes.