Virtual extensions to the logical tree

I was helping someone out on this thread in the WPF Forum the other day.  Basically the guy wanted to bind a property on a custom ValidationRule to some value in a template’s DataContext.  This turned out to be much tricker than it initially appeared.  I figured out a way to do it, by designing a technique which allows you to “attach a virtual branch” to the logical tree.  I won’t bother describing it in detail here, because I just posted a CodeProject article about it:

In my opinion, this is the most interesting and useful contribution I’ve ever made to the WPF community.  I’m looking forward to seeing how people use this pattern in their applications.


One Response to Virtual extensions to the logical tree

  1. Pushing values into resources

    Josh Smith just posted a new pattern for “Virtual Branches” in WPF – allowing bindings on elements which are not in the logical tree. It works by rerouting the DataContext through StaticResource references. It’s undoubtedly interesting, but I’m le…

%d bloggers like this: