Understanding Visual Tree and Logical Tree

When talking about WPF applications, you will often hear about the Logical Tree and the Visual Tree. The Logical Tree is a tree representation of the .NET classes for user interface controls. Consider the following XAML code:

<Window>    <StackPanel Orientation="Horizontal" Margin="5">        <TextBlock Text="Sample controls" Margin="5"/>        <Button Content="Test button" Margin="5"/>    </StackPanel></Window>

This code uses .NET objects within a hierarchical structure that can be reconfigured in a Logical Tree, as shown in Figure 28.8.

Image

FIGURE 28.8 The Logical Tree ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.