Reputation: 6689
I have a ComboBox that is bound to a collection of CLR objects. Each item in the ComboBox is displayed via a DataTemplate. This DataTemplate contains an Image and a Title associated with the item. After a user clicks an item in the ComboBox, I want to display the selected items Title in another TextBlock in the screen.
My question is, how do I bind the Text property of the TextBlock to the Title property of the item selected in the comboBox?
Thank you!
Upvotes: 0
Views: 1977
Reputation: 2563
Assuming you called the ComboBox "ComboBox1" You could use-
<TextBlock Text="{Binding ElementName=ComboBox1,Path=SelectedItem.Title}"/>
Upvotes: 2