I'm writing a WPF app and I want the DataTemplate that gets applied to vary based on the state of the data.
For example, imagine the following ContentControl:
<ContentControl ContentTemplateSelector='...'>
<ContentControl.Content>
<l:Person Name='Chris Sells' Age='19' />
</ContentControl.Content>
</ContentControl>
In my DataTemplateSelector, I can easily look at the entirety of the content to determine which template to apply.
That's great.
Unfortunately, there's no way I can find to tell the ContentControl to “repull” for a new template when the subordinate properties of the content change. AFAICT, the only time my template selector gets repulled is when the Content property itself is set again.
I've already asked the authors of two WPF books for an elegant solution, but came up empty.
Who's going to assert WPF alpha-geek and show us all how it's done?
Posted
Oct 01 2007, 01:46 PM
by
don-box