WPF DataContext vs ItemsSource Performance
1 answer
Well, the difference in performance doesn't really matter as the two lines do completely different things. DataContext is the object from which the local data bindings of the ItemsControl come from:
<ItemsControl Width={Binding Length} />
Take the Length property of the DataContext and bind it to the Width dependency property of the ItemsControl.
On the other hand, ItemSource is an IEnumerable object that must be iterated over to create child items inside the control. (Every object inside the ItemSource will become the DataContext of the created child)
+11
source to share