Link to DependencyObjects Collection in Silverlight 4

In Silverlight 4, you can bind data to a DependencyObject (instead of the Framework element in previous versions). So far so good, but how do I link the DependencyObjects collection again.

The DataContext is not passed from the ObservableCollection to the elements of the collection, so DependencyProperties of DependencyObjects are never called (nor changed events). Neither DependencyObject offers a SetBinding or DataContext to initialize the binding manually.

Thanks for any advice here.

+3
source share
1 answer

In order to get the DataContext spread in this case, the DependencyProperty that contains the collection must be of type DependencyObjectCollection<T> . The DataContext is distributed through DependencyProperties and DependencyObjectCollections.

+3
source

All Articles