navigating-visual-logical-tree
Installation
SKILL.md
WPF Visual Tree & Logical Tree Patterns
In WPF, element relationships are represented by two tree structures.
1. Core Differences
1.1 Logical Tree
- Structure of elements explicitly declared in XAML
- Based on Content relationships
- Event routing path
- Inherited property (DataContext, FontSize, etc.) propagation path
1.2 Visual Tree
- Includes all elements actually rendered
- Includes elements inside ControlTemplate
- Basis for Hit Testing
- Determines rendering order