Hello!
The CompositeCollection may be quite useful, but it seems like it may not be used with HierarchicalDataTemplate. Isn't there a way to achive that
I think of something like:
<HierarchicalDataTemplate.ItemsSource>
<CompositeCollection>
<CollectionContainer Collection="{Binding Source={StaticResource GreekGodsData}}" />
<CollectionContainer Collection="{Binding Source={StaticResource GreekHeroesData}}" />
</CompositeCollection>
</HierarchicalDataTemplate.ItemsSource>

HierarchicalDataTemplate.ItemsSource and CompositeCollection
Animesh
I had this same problem:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=220060&SiteID=1
ajay4074
Hi Johann!
It was also for a TreeView I tried to do it. Thank you very much for your reply. Unfortunately it just made it evident that it's not possible. The suggestion of putting a WPF semantical expression power compensating property in the model is really ugly.
I must say that I'm rather worried of all the StaticResource driven demos as it does not show typical needs of e.g. making a wrapper instance for the model object retrieved by a property object reference and the like. For instance the idea of the model/view/viewmodel without being able to instantiate the viewmodel object on the fly seems rather underpowered for real usage.
Do other's have the same concerns or what do you say
Best regards,
Henrik Dahl
kennydmac
This is the same issue as binding a HierarchicalDataTemplate's ItemsSource to a CollectionViewSource: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=348425&SiteID=1.
The data binding team is very well aware of the limitations here. We've discussed this scenario and we want to support it, but this is likely not going to happen for V1. I completely agree with you that this should be easy to do, and I don't like the fact that people have to come up with ugly workarounds. This is in the list of features we want to add for V2 and will not be forgotten.
Bea
Noordin
No, I agree. A lot of samples work great with simple senarios (StaticResource), but end up not working on more complicated senarios.
I actually posted this as a bug: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=2ac98a9e-af07-48c9-8b3c-ab4416b92ad0
Unfortuantly it's postponed. The thread I posted has a workaround, but it's not perfect.
EDIT: I re-opened the bug I posted above. Please vote for it and post a comment.