0
votes

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!

1

1 Answers

2
votes

Assuming you called the ComboBox "ComboBox1" You could use-

<TextBlock Text="{Binding ElementName=ComboBox1,Path=SelectedItem.Title}"/>