0

I need a way to access the ContentPresenter/ItemsPresenter from a control if it does exist.

I can't figure out how to easily do this with VisualTreeHelper.

Will I need to recursively search all children?

Lee Louviere
  • 5,162
  • 30
  • 54

1 Answers1

1

Yes you need to recurse through the Visual tree....FindVisualChild can do that for you...if you supply it with an instance to the control.

ContentPresenter myContentPresenter = FindVisualChild(dependencyobject);

Some links:

Colin Smith
  • 12,375
  • 4
  • 39
  • 47