1

As far as I understand, a logical tree is always a subset of the visual tree of some element in WPF. Technically, the distinction between the two is whether or not they are assigned to the Template property of an element (= visual) or to the Content, Children or Child properties thereof (= logical).

What I wonder is this: Within the visual tree that I assign to a Template property, I can recusively have logical and visual trees again, since I can simply assign the Template respectively Content of a visual tree’s descendants again.

Is this true, and if so, how are the properties (like dependency property inheritance) of inner visual/logical trees different from those of the outermost?

domin
  • 1,192
  • 1
  • 7
  • 28
  • you build logical tree not only via `Content` property of contentcontrols, but also with `Children` of panels and `Child` of decorators. oh, wait, there is also headeredcontentcontrol with Header and who knows how many custom controls which adds content-like properties. When you visit descendant node of a tree, you get a subtree, which is shorter but the same concept as top-level tree – ASh Nov 14 '17 at 08:10
  • @ASh So, then those logical-child-properties are somehow hard-coded by WPF to mean "here we can have logical children"? Or what else do they have in common that uniquely identifies them as logical children? – domin Nov 14 '17 at 08:17
  • I think [this documentation article](https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/trees-in-wpf) explains trees concepts better than I can do in a comment. – ASh Nov 14 '17 at 08:26

0 Answers0