WPFwiki, wpf, wiki, .net 3.0, windows presentation foundation, FAQ, free resources, solution, development, microsoft Home of the world's largest WPF FAQ
Edit

Category

Fundamentals

Edit

Question

What is the difference between the Logical Tree and the Visual Tree?

Edit

Answer

The Logical Tree is a tree structure that represents the hierarchy of controls and elements that constitute a piece of user interface in WPF, but without their inner parts.

For example, if a DockPanel contains a ListBox which contains a list of Buttons, the Logical Tree will consist of the following:

DockPanel
 +ListBox
   +Button
   +Button
   +Button


The Visual Tree is a tree structure that represents the fine-grained hierarchy of Visuals that constitute what appears on the screen. It contains the same elements as the Logical Tree, but includes all the Visuals that are used to compose the Logical Tree's controls and elements, like the ControlTemplates and DataTemplates.

The Visual Tree of the previous example would therefore be as follows:

DockPanel
    +ListBox
      +Border
        +...
        +VirtualizingStackPanel
          +ListBoxItem
            +Button
              +Border
              +....


Edit

Keywords

visual, logical tree, visualtree, logicaltree, essays

Edit

Keywords

philippine travel, travel asia, mayweather vs ortiz tickets, mayweather vs ortiz, pacquiao vs marquez, mayweather vs ortiz live streaming, pacquiao vs marquez tickets, pacquiao vs marquez, hopkins vs dawson, hopkins vs dawson live streaming, donaire vs narvaez, donaire vs narvaez tickets, cotto vs margarito, cotto vs margarito tickets, st-Pierre vs diaz, st-Pierre vs diaz tickets, fifa world cup, Reverse Cell Phone Lookup, Pellet Stoves, Outdoor Lighting, Outdoor Flood Lights Used Pellet Stoves

All content is Copyright ©2007 Xceed Software Inc. unless otherwise indicated. See the Terms of Service. Contributors must read and agree to the Contribution Policy. WPFwiki is brought to you by Xceed, makers of the powerful yet free Xceed DataGrid for WPF.