CompositeCollection support?

Topics: Conventions, Extensibility, Feature Requests
May 7, 2012 at 1:17 PM
Edited May 7, 2012 at 1:17 PM

Is there any form of support for CompositeCollection. Basically, it's used for an ItemsControl.ItemsSource when you want to bind to 2 or more collections. Apparently I can't bind to a property and the CC has no datacontext. The below code shows it not-working :P

                        <CollectionContainer Collection="{Binding Path=Nodes}" />
                        <CollectionContainer Collection="{Binding Path=Connections}" />
                <local:NodePanel />

May 7, 2012 at 1:47 PM
Edited May 7, 2012 at 1:48 PM

Solution was to follow this:

1) Made the CompositeCollection a resource in the UserControl.

2) Gave my UserControl the name "root" (it doesnt matter what it is), set each CollectionContainer's binding source to x:Reference root

The view/datatemplate for the items was not set correctly using this method.