How to loop through controls in a DocumentWindow?

Docking/MDI for WPF Forum

Posted 13 years ago by ryan phelps
Version: 11.1.0542


I've been trying to do something fairly simple (I thouight). Basically I want to loop through all the controls that are within a DocumentWindow. I thought the C# code would be something like:

// testDocumentWindow, DocumentWindow containing other controls

foreach (object obj in testDocumentWindow.Items)
//do something

There are no attributes for testDocumentWindow.Controls, testDocumentWindow.Children or testDocumentWindow.Items.

Could someone please help.



Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Ryan,

The DocumentWindow is a ContentControl, so it will effectively only have 1 child element. You can use VisualTreeHelper and our VisualTreeHelperExtended to walk the visual tree to get any descendents/children.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.