When working with collection-like data sources in WPF, you can read properties of the selected item by writing your binding expressions as though there were only one source object. Here’s an example: < DockPanel DataContext = " {x:Static Fonts.SystemFontFamilies} " > < TextBlock DockPanel.Dock = " Top " Text = " {Binding Baseline} " /> < ListBox ItemsSource = " {Binding} " IsSynchronizedWithCurrentItem = " True " /> </ DockPanel > The data source here is a collection – an array of FontFamily objects. The ListBox displays all of the items in this array. However, the TextBlock has a binding expression that seems to make no sense – it tries to read the Baseline property, and yet the source, an array, has no such property. When WPF encounters a binding to a non-existent property on a collection, WPF has a fallback strategy: it looks for the named property on the current item. Consequently, the TextBlock shows the Baseline property of the currently selected font. This
Read More...