という UserControl がありZoneContainerます。これにはListBox、いくつかの を含む を含むプロパティがありますListItem。各 ListItem にはDockPanel.
ZoneContainer次のコードを使用して、内部に存在するがchildrenCount毎回0である子を見つけようとしています。
var parent = this as DependencyObject; // I can see that this is populated.
int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
オブジェクトのリスト内で特定の子オブジェクトを見つける別の方法はありますか? 最終的には、DockPanel を見つけようとしていますが、オブジェクト内にあることがわかっていても、子が見つかりません。