How to aggregate bindings in Silverlight UserControl
- by Peter Wone
Imagine a UserControl containing some sort of ItemsControl. The UserControl as a whole has a DataContext, but you also need to expose the ItemsSource of the ItemsControl.
I have tried all manner of arrangements, and eventually passed a DomainDataSource as a UserControl dependency property named DDS, and bound the ItemsControl like this:
ItemsSource="{Binding DDS.Data, ElementName=userControl}"
It works, but this is mucky, and with Silverlight mucky is nearly always a sign of incorrect approach. Your advice is sought.
It looks like multi-bindings might be the answer to this.