In Microsoft’s Windows Presentation Foundation, I think one of the more difficult things for programmers coming from WinForms and ASP.NET to conceptualize is how to work with the logical and visual control trees. A common way this manifests itself is in how to navigate a TreeView control. I struggled with this quite a lot, but finally got it with some help from the guys on the MDSN forum. I’m posting the sample I made here. Hope this is helpful to someone.