Jaa


TreeListView - Scary Cool Control Mash-up in WPF

As promised, the ATC team has posted another ListView sample. This sample is amazing because it doesn’t involve ListView at all. Instead, it uses the primitives we designed for ListView--namely GridViewColumn and GridViewRowPresenter. The code required here is amazingly small for the flexibility of the end experience.

The lessons here are important for control authors:

  • Build your controls the right way and you’ll drastically increase their flexibility and reuse. (We didn’t design GridViewRowPresenter for a TreeView, but it just happens to work because of the inherently compositional nature of WPF.)
  • Don’t start from scratch when you build a control. It’s easy to remix the pieces we provide in the platform to enable unique and valuable experiences.