I have a listbox that is displaying several attributes from an XML file. How can I update a textbox whenever you select one of these items on the listbox? My listbox looks like this:
<ListBox Name="RouterSelection" ItemsSource="{Binding Source={StaticResource RoutingData}, XPath=Routes/Route/IdClient}"/>
and my textbox looks like this:
<TextBox DataContext="{Binding ElementName=RouterSelection, Path=SelectedItem}" Text="{Binding XPath=@Value}"/>
But the textbox is not showing the content when you select any of the items. What am I missing? Thanks for any help!
Try
and set SelectedValuePath for ListBox