In WPF, the concept of a logical tree is critical. If a WPF developer does not know what a logical tree is or has a smattering of logical trees, then he is not a qualified WPF developer. Here's how the concept of the logical tree is more easily misinterpreted:
1. The logical tree does not exist only in objects built using XAML, but also in the logical tree of objects built using program code.
XAML is a new API dedicated to WPF programming, just like C # was used exclusively for. NET Development APIs. Therefore, as long as the "interface
object is created, we can draw a logical tree for it.
2, the logical tree is to describe the "interface object" construction process, rather than "interface object" structure.
The logical tree is composed of "interface objects" and the objects they contain, which are added to the object when the interface object is created
The "interface Object").
3. The logical tree is composed of "interface object" and "Content attribute", among them is "parent node" and "Child node" in tree structure. "Child Node" Also
You can continue to expand until "child nodes" no longer contain content attributes, so you can say that this "child node" is a "leaf point" in the logical tree.
4, no value of the "Content property" does not appear in the logical tree, only the property value of the "Content property" is a logical tree node.
Having mastered the above, we can easily draw the logical tree it represents when we get a XAML or a section of C # code. Wpf
Many of the concepts in it need to rely on the logical tree to help understand, so it is important to draw the logical tree correctly.