Article about WPF element trees

I just published an article on CodeProject which discusses subtleties of the visual tree and logical tree in WPF.  It is accompanied by a small application which can be used to research the topics in more detail.  If you want to check it out, here’s the link:

6 Responses to Article about WPF element trees

  1. Karl Shifflett says:

    Way awesome teaching on WPF’s Forest or should that be WPF’s Ocean Dude!

    What with all the trees and islands with their own trees, my question is, what came first? The chicken or the egg. (tree or island) :-))

    Thank you for sharing with us mortals!

  2. Josh Smith says:


    We’re going to add that logical tree feature into Mole, so get your liferaft ready! We’ll be sailing the Logical Archipelago soon enough! 🙂


  3. RobLo says:

    Hey Josh,

    This is some good stuff! Where does Storyboard, Animation, and Timeline fit into the forest?


  4. Josh Smith says:


    Those type of objects are not usually found in a visual or logical tree. They have no visual representation, so they won’t be part of the visual tree. They are not part of a UI’s structure, so they are not part of the logical tree.


  5. RobLo says:

    Ok. Thanks for the info.

    Is there any way of finding all the animations running in my application?

    Maybe I am going about this the wrong way, I am trying to design an application that can be defined by ‘loose XAML’ pages. The ‘loose XAML’ pages may have a Storyboard. I want to add the Completed handler to my application. And to stop/pause the animation whenever the application switches to a new page.


  6. Josh Smith says:


    Off the top of my head…keep all the animations in the the Window’s/Page’s/UserControl’s/etc Resources collection. When you load the loose XAML file, loop over the Resources and look for objects of type Animation.


%d bloggers like this: